--- a/hgext/evolve.py Thu Jul 09 12:42:07 2015 -0700
+++ b/hgext/evolve.py Fri Jul 10 22:58:13 2015 +0100
@@ -2137,6 +2137,8 @@
('r', 'rev', [], _("revisions to prune")),
('k', 'keep', None, _("does not modify working copy during prune")),
('', 'biject', False, _("do a 1-1 map between rev and successor ranges")),
+ ('', 'fold', False, _("record a fold (multiple precursors, one successors)")),
+ ('', 'split', False, _("record a split (on precursor, multiple successors)")),
('B', 'bookmark', '', _("remove revs only reachable from given"
" bookmark"))] + metadataopts,
_('[OPTION] [-r] REV...'))
@@ -2159,12 +2161,22 @@
revisions to prune and successor changesets. This option may be removed in
a future release (with the functionality absorbed automatically).
+ If you specify multiple revisions in --succ, you are recording a "split"
+ and have to acknowledge it by usng --split. The same logic apply when you
+ prune multiple changesets with a single successors, this will record a
+ "fold" requires a --fold flag.
"""
revs = scmutil.revrange(repo, list(revs) + opts.get('rev'))
succs = opts['new'] + opts['succ']
bookmark = opts.get('bookmark')
metadata = _getmetadata(**opts)
biject = opts.get('biject')
+ fold = opts.get('fold')
+ split = opts.get('split')
+
+ options = [o for o in ('biject', 'fold', 'split') if opts.get(o)]
+ if 1 < len(options):
+ raise util.Abort(_("can only specify one of %s") % ', '.join(options))
if bookmark:
marks,revs = _reachablefrombookmark(repo, revs, bookmark)
@@ -2204,15 +2216,20 @@
if not biject and len(sucs) > 1 and len(precs) > 1:
msg = "Can't use multiple successors for multiple precursors"
raise util.Abort(msg)
-
- if biject and len(sucs) != len(precs):
+ elif biject and len(sucs) != len(precs):
msg = "Can't use %d successors for %d precursors" \
% (len(sucs), len(precs))
raise util.Abort(msg)
-
- relations = [(p, sucs) for p in precs]
- if biject:
+ elif (len(precs) == 1 and len(sucs) > 1) and not split:
+ msg = "please add --split if you want to do a split"
+ raise util.Abort(msg)
+ elif len(sucs) == 1 and len(precs) > 1 and not fold:
+ msg = "please add --fold if you want to do a fold"
+ raise util.Abort(msg)
+ elif biject:
relations = [(p, (s,)) for p, s in zip(precs, sucs)]
+ else:
+ relations = [(p, sucs) for p in precs]
wdp = repo['.']
--- a/tests/test-amend.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-amend.t Fri Jul 10 22:58:13 2015 +0100
@@ -115,6 +115,7 @@
branch: foo
commit: 1 unknown (clean)
update: (current)
+ phases: 3 draft
Check the help
$ hg amend -h
--- a/tests/test-corrupt.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-corrupt.t Fri Jul 10 22:58:13 2015 +0100
@@ -101,7 +101,7 @@
summary: add A
- $ hg kill -n -1 -- -2 -3
+ $ hg kill --fold -n -1 -- -2 -3
2 changesets pruned
$ hg push ../other
pushing to ../other
@@ -110,8 +110,7 @@
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
- pushing 2 obsolescence markers (*) (glob)
- 2 obsolescence markers added
+ 2 new obsolescence markers
$ hg -R ../other verify
checking changesets
checking manifests
--- a/tests/test-evolve-bumped.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-evolve-bumped.t Fri Jul 10 22:58:13 2015 +0100
@@ -49,7 +49,6 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pull obsolescence markers
(run 'hg update' to get a working copy)
$ hg log -r 'draft()'
1:4d1169d82e47@default(draft) modify a
@@ -68,7 +67,6 @@
pulling from ../public
searching for changes
no changes found
- pull obsolescence markers
1 new bumped changesets
$ hg evolve -a -A --bumped
--- a/tests/test-evolve-split.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-evolve-split.t Fri Jul 10 22:58:13 2015 +0100
@@ -43,7 +43,7 @@
$ printf "pp" > pp;
$ hg add pp
$ hg commit -m "_pp"
- $ hg prune --succ "desc(_oo) + desc(_pp)" -r "desc('oo+pp')"
+ $ hg prune --succ "desc(_oo) + desc(_pp)" -r "desc('oo+pp')" --split
1 changesets pruned
1 new unstable changesets
$ hg log -G
--- a/tests/test-evolve.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-evolve.t Fri Jul 10 22:58:13 2015 +0100
@@ -474,7 +474,6 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pull obsolescence markers
$ cd alpha
$ cat << EOF > A
@@ -531,8 +530,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pull obsolescence markers
- 2 obsolescence markers added
+ 2 new obsolescence markers
(run 'hg update' to get a working copy)
$ hg up
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -1374,7 +1372,7 @@
$ printf "pp" > pp;
$ hg add pp
$ hg commit -m "_pp"
- $ hg prune --succ "desc(_oo) + desc(_pp)" -r "desc('oo+pp')"
+ $ hg prune --succ "desc(_oo) + desc(_pp)" -r "desc('oo+pp')" --split
1 changesets pruned
1 new unstable changesets
$ glog -r "18::"
--- a/tests/test-inhibit.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-inhibit.t Fri Jul 10 22:58:13 2015 +0100
@@ -133,6 +133,7 @@
branch: default
commit: (clean)
update: 1 new changesets, 2 branch heads (merge)
+ phases: 6 draft
check public revision got cleared
(when adding the second inhibitor, the first one is removed because it is public)
@@ -352,7 +353,8 @@
+cD
$ hg export 1 3
- abort: filtered revision '1' (not in 'visible-directaccess-nowarn' subset)!
+ abort: hidden revision '1'!
+ (use --hidden to access hidden revisions)
[255]
@@ -397,7 +399,8 @@
o 0:54ccbc537fc2 add cA
$ hg rebase -s 10 -d 3
- abort: filtered revision '3' (not in 'visible-directaccess-warn' subset)!
+ abort: hidden revision '3'!
+ (use --hidden to access hidden revisions)
[255]
$ hg rebase -r ad78ff7d621f -r 53a94305e133 -d 2db36d8066ff
Warning: accessing hidden changesets 2db36d8066ff for write operation
@@ -758,5 +761,4 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pushing 33 obsolescence markers (*) (glob)
- 2 obsolescence markers added
+ 2 new obsolescence markers
--- a/tests/test-obsolete.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-obsolete.t Fri Jul 10 22:58:13 2015 +0100
@@ -184,8 +184,7 @@
adding manifests
adding file changes
added 5 changesets with 5 changes to 5 files (+1 heads)
- pushing 2 obsolescence markers (*) (glob)
- 2 obsolescence markers added
+ 2 new obsolescence markers
$ hg -R ../other-new verify
checking changesets
checking manifests
@@ -239,8 +238,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pushing 3 obsolescence markers (*) (glob)
- 1 obsolescence markers added
+ 1 new obsolescence markers
$ qlog -R ../other-new
5
- 95de7fc6918d
@@ -262,8 +260,6 @@
pushing to ../other-new
searching for changes
no changes found
- pushing 3 obsolescence markers (*) (glob)
- 0 obsolescence markers added
[1]
$ hg up --hidden -q .^ # 3
@@ -279,9 +275,8 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to [12] files \(\+1 heads\) (re)
- pull obsolescence markers
- 1 obsolescence markers added
- (run 'hg heads' to see heads, 'hg merge' to merge)
+ 1 new obsolescence markers
+ (run 'hg heads .' to see heads, 'hg merge' to merge)
$ qlog -R ../other-new
6
- 909a0fb57e5d
@@ -370,9 +365,8 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to [12] files \(\+1 heads\) (re)
- pull obsolescence markers
- 1 obsolescence markers added
- (run 'hg heads' to see heads, 'hg merge' to merge)
+ 1 new obsolescence markers
+ (run 'hg heads .' to see heads, 'hg merge' to merge)
$ hg up -q 7 # to check rollback update behavior
$ qlog
@@ -395,6 +389,7 @@
branch: default
commit: 1 deleted, 2 unknown (clean)
update: 2 new changesets, 2 branch heads (merge)
+ phases: 4 draft
unstable: 1 changesets
$ qlog
6
@@ -544,8 +539,7 @@
adding manifests
adding file changes
added 2 changesets with 1 changes to [12] files (re)
- pushing 7 obsolescence markers (*) (glob)
- 3 obsolescence markers added
+ 3 new obsolescence markers
$ hg up -q 10
$ mkcommit "obsol_d'''"
created new head
@@ -557,8 +551,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pushing 8 obsolescence markers (*) (glob)
- 1 obsolescence markers added
+ 1 new obsolescence markers
$ cd ..
check bumped detection
@@ -670,6 +663,7 @@
branch: default
commit: (clean)
update: (2|9|11) new changesets, (3|9|10) branch heads \(merge\) (re)
+ phases: 3 draft
bumped: 1 changesets
$ hg debugobsolete `getid a7a6f2b5d8a5` `getid 50f11e5e3a63`
$ hg log -r 'divergent()'
--- a/tests/test-prune.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-prune.t Fri Jul 10 22:58:13 2015 +0100
@@ -32,6 +32,19 @@
o 0:1f0dee641bb7[] (stable/public) add a
+Check arguments exclusive to each other
+---------------------------------------
+
+ $ hg prune --fold --biject
+ abort: can only specify one of biject, fold
+ [255]
+ $ hg prune --split --fold
+ abort: can only specify one of fold, split
+ [255]
+ $ hg prune --split --fold --biject
+ abort: can only specify one of biject, fold, split
+ [255]
+
Check simple case
----------------------------
@@ -150,6 +163,9 @@
one old, two new
$ hg prune 'desc("add dd")' -s 'desc("add nD")' -s 'desc("add nC")'
+ abort: please add --split if you want to do a split
+ [255]
+ $ hg prune 'desc("add dd")' -s 'desc("add nD")' -s 'desc("add nC")' --split
1 changesets pruned
$ hg debugobsolete
9d206ffc875e1bc304590549be293be36821e66c 0 {47d2a3944de8b013de3be9578e8e344ea2e6c097} (Sat Dec 15 00:00:00 1979 +0000) {'user': 'blah'}
@@ -190,6 +206,9 @@
two old, one new:
$ hg prune 'desc("add cc")' 'desc("add bb")' -s 'desc("add nB")'
+ abort: please add --fold if you want to do a fold
+ [255]
+ $ hg prune 'desc("add cc")' 'desc("add bb")' -s 'desc("add nB")' --fold
2 changesets pruned
$ hg debugobsolete
9d206ffc875e1bc304590549be293be36821e66c 0 {47d2a3944de8b013de3be9578e8e344ea2e6c097} (Sat Dec 15 00:00:00 1979 +0000) {'user': 'blah'}
--- a/tests/test-sharing.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-sharing.t Fri Jul 10 22:58:13 2015 +0100
@@ -46,7 +46,6 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pull obsolescence markers
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Let's commit a preliminary change and push it to ``test-repo`` for
@@ -88,8 +87,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pull obsolescence markers
- 2 obsolescence markers added
+ 2 new obsolescence markers
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Figure SG03
@@ -140,8 +138,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pushing 4 obsolescence markers (*) (glob)
- 4 obsolescence markers added
+ 4 new obsolescence markers
Now that the fix is public, we cannot amend it any more.
$ hg amend -m 'fix bug 37'
@@ -161,8 +158,6 @@
pushing to ../dev-repo
searching for changes
no changes found
- pushing 4 obsolescence markers (*) (glob)
- 0 obsolescence markers added
[1]
$ hg -R ../dev-repo shortlog -r 'draft()'
@@ -196,8 +191,6 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pushing 4 obsolescence markers (*) (glob)
- 0 obsolescence markers added
exporting bookmark bug15
$ hg -R ../review bookmarks
bug15 2:f91e97234c2b
@@ -213,8 +206,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pushing 6 obsolescence markers (*) (glob)
- 2 obsolescence markers added
+ 2 new obsolescence markers
updating bookmark bug15
$ hg -R ../review bookmarks
bug15 3:cbdfbd5a5db2
@@ -241,8 +233,6 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pushing 4 obsolescence markers (*) (glob)
- 0 obsolescence markers added
exporting bookmark featureX
$ hg -R ../review bookmarks
bug15 3:cbdfbd5a5db2
@@ -259,8 +249,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pushing 6 obsolescence markers (*) (glob)
- 2 obsolescence markers added
+ 2 new obsolescence markers
updating bookmark featureX
Bob receives second review, amends, and pushes to public:
@@ -274,8 +263,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pushing 8 obsolescence markers (*) (glob)
- 4 obsolescence markers added
+ 4 new obsolescence markers
$ hg -R ../public bookmarks
no bookmarks set
$ hg push ../review
@@ -286,8 +274,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pushing 8 obsolescence markers (*) (glob)
- 2 obsolescence markers added
+ 2 new obsolescence markers
updating bookmark featureX
$ hg -R ../review bookmarks
bug15 3:cbdfbd5a5db2
@@ -357,8 +344,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pull obsolescence markers
- 4 obsolescence markers added
+ 4 new obsolescence markers
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg log -G -q -r 'head()'
o 5:540ba8f317e6
@@ -388,8 +374,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pushing 11 obsolescence markers (*) (glob)
- 3 obsolescence markers added
+ 3 new obsolescence markers
$ hg push ../review
pushing to ../review
searching for changes
@@ -397,8 +382,7 @@
adding manifests
adding file changes
added 1 changesets with 0 changes to 1 files
- pushing 11 obsolescence markers (*) (glob)
- 1 obsolescence markers added
+ 1 new obsolescence markers
updating bookmark bug15
Figure SG08: review and public changesets after Alice pushes.
@@ -460,8 +444,6 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pull obsolescence markers
- 0 obsolescence markers added
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo 'better fix (alice)' >> file1
$ hg amend -u alice -m 'fix bug 24 (v2 by alice)'
@@ -489,8 +471,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pull obsolescence markers
- 2 obsolescence markers added
+ 2 new obsolescence markers
(run 'hg heads' to see heads, 'hg merge' to merge)
2 new divergent changesets
--- a/tests/test-simple4server.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-simple4server.t Fri Jul 10 22:58:13 2015 +0100
@@ -96,7 +96,7 @@
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files (+1 heads)
- pushing 2 obsolescence markers (*) (glob)
+ pushing 2 obsolescence markers (* bytes) (glob)
$ cat ../errors.log
$ hg push
pushing to http://localhost:$HGPORT/
--- a/tests/test-stabilize-result.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-stabilize-result.t Fri Jul 10 22:58:13 2015 +0100
@@ -307,6 +307,7 @@
branch: default
commit: (clean)
update: 2 new changesets, 2 branch heads (merge)
+ phases: 3 draft
$ hg export .
# HG changeset patch
# User test
--- a/tests/test-tutorial.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-tutorial.t Fri Jul 10 22:58:13 2015 +0100
@@ -224,7 +224,6 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pull obsolescence markers
(run 'hg heads' to see heads, 'hg merge' to merge)
I now have a new heads. Note that this remote head is immutable
@@ -406,8 +405,7 @@
adding manifests
adding file changes
added 3 changesets with 3 changes to 1 files
- pushing 6 obsolescence markers (*) (glob)
- 6 obsolescence markers added
+ 6 new obsolescence markers
for simplicity sake we get the bathroom change in line again
@@ -527,8 +525,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pull obsolescence markers
- 1 obsolescence markers added
+ 1 new obsolescence markers
(run 'hg update' to get a working copy)
$ hg log -G
o 75954b8cd933 (public): bathroom stuff
@@ -585,8 +582,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pull obsolescence markers
- 1 obsolescence markers added
+ 1 new obsolescence markers
(run 'hg update' to get a working copy)
$ hg log -G
o 75954b8cd933 (draft): bathroom stuff
@@ -646,8 +642,6 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
- pull obsolescence markers
- 0 obsolescence markers added
(run 'hg heads' to see heads, 'hg merge' to merge)
1 new unstable changesets
@@ -737,8 +731,7 @@
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files (+1 heads)
- pushing 10 obsolescence markers (*) (glob)
- 3 obsolescence markers added
+ 3 new obsolescence markers
remote get a warning that current working directory is based on an obsolete changeset
@@ -747,8 +740,6 @@
pulling from $TESTTMP/local (glob)
searching for changes
no changes found
- pull obsolescence markers
- 0 obsolescence markers added
working directory parent is obsolete!
(use "hg evolve" to update to its successor)
@@ -781,8 +772,6 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pull obsolescence markers
- 0 obsolescence markers added
(run 'hg update' to get a working copy)
$ hg log -G
o 99f039c5ec9e (draft): SPAM SPAM SPAM
--- a/tests/test-uncommit.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-uncommit.t Fri Jul 10 22:58:13 2015 +0100
@@ -138,7 +138,6 @@
$ hg branch foo
marked working directory as branch foo
- (branches are permanent and global, did you want a bookmark?)
$ hg mv ff f
$ hg mv h i
$ hg rm j
--- a/tests/test-wireproto-bundle1.t Thu Jul 09 12:42:07 2015 -0700
+++ b/tests/test-wireproto-bundle1.t Fri Jul 10 22:58:13 2015 +0100
@@ -50,7 +50,6 @@
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
- pull obsolescence markers
(run 'hg update' to get a working copy)
$ hg push -R ../other
pushing to ssh://user@dummy/server
@@ -70,8 +69,7 @@
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files (+1 heads)
- pushing 2 obsolescence markers (*) (glob)
- remote: 2 obsolescence markers added
+ remote: 2 new obsolescence markers
$ hg push
pushing to ssh://user@dummy/server
searching for changes
@@ -88,9 +86,8 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to [12] files \(\+1 heads\) (re)
- pull obsolescence markers
- 2 obsolescence markers added
- (run 'hg heads' to see heads)
+ 2 new obsolescence markers
+ (run 'hg heads' to see heads, 'hg merge' to merge)
$ hg -R ../other pull
pulling from ssh://user@dummy/server
searching for changes