Mercurial > evolve
changeset 420:b6163a85ddac
merge
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Sun, 05 Aug 2012 12:02:45 +0200 |
parents | 03672e955bc8 (current diff) 18a0d96ed559 (diff) |
children | 97c46754553d |
files | hgext/evolve.py hgext/obsolete.py tests/test-evolve.t |
diffstat | 3 files changed, 63 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/evolve.py Sat Aug 04 12:44:51 2012 +0200 +++ b/hgext/evolve.py Sun Aug 05 12:02:45 2012 +0200 @@ -359,7 +359,7 @@ 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) @@ -637,17 +637,16 @@ 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: @@ -662,12 +661,12 @@ 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,
--- a/hgext/obsolete.py Sat Aug 04 12:44:51 2012 +0200 +++ b/hgext/obsolete.py Sun Aug 05 12:02:45 2012 +0200 @@ -35,11 +35,7 @@ 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. """ @@ -685,7 +681,7 @@ 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
--- a/tests/test-evolve.t Sat Aug 04 12:44:51 2012 +0200 +++ b/tests/test-evolve.t Sun Aug 05 12:02:45 2012 +0200 @@ -54,6 +54,15 @@ 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 @@ -356,6 +365,7 @@ (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 @@ -402,5 +412,51 @@ $ 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 ..