Commits

Pierre-Yves David committed b6163a8 Merge

merge

  • Participants
  • Parent commits 03672e9, 18a0d96
  • Branches default

Comments (0)

Files changed (3)

             new = [node.nullid]
         for n in targetnodes:
             if not repo[n].mutable():
-                ui.warn(_("Can't kill immutable changeset %s") % repo[n])
+                ui.warn(_("cannot kill immutable changeset %s\n") % repo[n])
             else:
                 for ne in new:
                     repo.addobsolete(ne, n)
     kwargs = dict(kwargs)
     revs = list(revs) + kwargs.get('rev', [])
     kwargs['rev'] = []
+    obsoleted = kwargs.setdefault('obsolete', [])
 
     lock = repo.lock()
     try:
         if kwargs.get('old_obsolete'):
-            obsoleted = kwargs.setdefault('obsolete', [])
-            if kwargs['continue']:
+            if kwargs.get('continue'):
                 obsoleted.extend(repo.opener.read('graftstate').splitlines())
             else:
                 obsoleted.extend(revs)
         # convert obsolete target into revs to avoid alias joke
-        obsoleted = kwargs.setdefault('obsolete', [])
         obsoleted[:] = [str(i) for i in repo.revs('%lr', obsoleted)]
         if obsoleted and len(revs) > 1:
 
     try:
         obsolete = extensions.find('obsolete')
     except KeyError:
-        raise error.Abort(_('evolution extension require obsolete extension.'))
+        raise error.Abort(_('evolution extension requires obsolete extension.'))
     try:
         rebase = extensions.find('rebase')
     except KeyError:
         rebase = None
-        raise error.Abort(_('evolution extension require rebase extension.'))
+        raise error.Abort(_('evolution extension requires rebase extension.'))
 
     for cmd in ['amend', 'kill', 'uncommit']:
         entry = extensions.wrapcommand(cmdtable, cmd,

hgext/obsolete.py

 New commands
 ------------
 
-Note that rebased changesets are not marked obsolete rather than being stripped
-In this experimental extensions, this is done forcing the --keep option. Trying
-to use the --keep option of rebase with this extensionn this experimental
-extension will cause such a call to abort. Until better releasen please use
-graft command to rebase and copy changesets.
+Note that rebased changesets are now marked obsolete instead of being stripped.
 
 """
 
         return
 
     if not util.safehasattr(repo.opener, 'tryread'):
-        raise util.Abort('Obsolete extension require Mercurial 2.2 (or later)')
+        raise util.Abort('Obsolete extension requires Mercurial 2.2 (or later)')
     opush = repo.push
     o_updatebranchcache = repo.updatebranchcache
 

tests/test-evolve.t

   1 - 7c3bad9141dc add b (public)
   0 - 1f0dee641bb7 add a (public)
 
+test kill and immutable changeset
+
+  $ hg log -r 1 --template '{rev} {phase} {obsolete}\n'
+  1 public stable
+  $ hg kill 1
+  cannot kill immutable changeset 7c3bad9141dc
+  $ hg log -r 1 --template '{rev} {phase} {obsolete}\n'
+  1 public stable
+
 test simple kill
 
   $ hg id -n
   (run 'hg update' to get a working copy)
   $ hg up
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
   $ cd ..
 
 Test graft --obsolete/--old-obsolete
   $ hg debugsuccessors
   0e84df4912da 0b9e50c35132
   db038628b9e5 acb28cd497b7
+
+Test graft --continue
+
+  $ hg up -qC 0
+  $ echo 2 > 1
+  $ hg ci -Am conflict 1
+  created new head
+  $ hg up -qC 6
+  $ hg graft -O 7
+  grafting revision 7
+  merging 1
+  warning: conflicts during merge.
+  merging 1 incomplete! (edit conflicts, then use 'hg resolve --mark')
+  abort: unresolved conflicts, can't continue
+  (use hg resolve and hg graft --continue)
+  [255]
+  $ hg log -r7 --template '{rev}:{node|short} {obsolete}\n'
+  7:a5bfd90a2f29 stable
+  $ echo 3 > 1
+  $ hg resolve -m 1
+  $ hg graft --continue -O
+  grafting revision 7
+  $ glog --hidden
+  @  8:920e58bb443b@default(draft) conflict
+  |
+  | x  7:a5bfd90a2f29@default(draft) conflict
+  | |
+  o |  6:acb28cd497b7@default(draft) add 1
+  | |
+  o |  5:0b9e50c35132@default(draft) add 3
+  | |
+  o |  4:ce341209337f@default(draft) add 4
+  |/
+  | x  3:0e84df4912da@default(draft) add 3
+  | |
+  | x  2:db038628b9e5@default(draft) add 2
+  | |
+  | o  1:73d38bb17fd7@default(draft) add 1
+  |/
+  o  0:8685c6d34325@default(draft) add 0
+  
+  $ hg debugsuccessors
+  0e84df4912da 0b9e50c35132
+  a5bfd90a2f29 920e58bb443b
+  db038628b9e5 acb28cd497b7
+
   $ cd ..