summary: move the parents phase marker to commit line (issue4688)
The phase of the pending commit depends on the parent of the working directory
and on the phases.newcommit configuration.
First, this information rather depend on the commit line which describe the
pending commit.
Then, we only want to be advertised when the pending phase is going to be higher
than the default new commit phase.
So the format will change from
$ hg summary
parent: 2:ab91dfabc5ad
foo
parent: 3:24f1031ad244 tip
bar
branch: default
commit: 1 modified, 1 unknown, 1 unresolved (merge)
update: (current)
phases: 1 secret (secret)
to
parent: 2:ab91dfabc5ad
foo
parent: 3:24f1031ad244 tip
bar
branch: default
commit: 1 modified, 1 unknown, 1 unresolved (merge) (secret)
update: (current)
phases: 1 secret
--- a/mercurial/commands.py Mon May 25 16:48:55 2015 -0700
+++ b/mercurial/commands.py Fri May 29 22:23:58 2015 +0200
@@ -6004,6 +6004,14 @@
elif pnode not in bheads:
t += _(' (new branch head)')
+ if parents:
+ pendingphase = max(p.phase() for p in parents)
+ else:
+ pendingphase = phases.public
+
+ if pendingphase > phases.newcommitphase(ui):
+ t += ' (%s)' % phases.phasenames[pendingphase]
+
if cleanworkdir:
# i18n: column positioning for "hg summary"
ui.status(_('commit: %s\n') % t.strip())
@@ -6034,16 +6042,8 @@
if secret:
t.append(_('%d secret') % secret)
- if parents:
- parentphase = max(p.phase() for p in parents)
- else:
- parentphase = phases.public
-
if draft or secret:
- ui.status(_('phases: %s (%s)\n') % (', '.join(t),
- phases.phasenames[parentphase]))
- else:
- ui.note(_('phases: (%s)\n') % phases.phasenames[parentphase])
+ ui.status(_('phases: %s\n') % ', '.join(t))
cmdutil.summaryhooks(ui, repo)
--- a/tests/test-backout.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-backout.t Fri May 29 22:23:58 2015 +0200
@@ -42,7 +42,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
commit option
@@ -70,7 +70,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 4 draft (draft)
+ phases: 4 draft
$ echo ypples > a
$ hg commit -d '5 0' -m ypples
@@ -85,7 +85,7 @@
branch: default
commit: 1 unresolved (clean)
update: (current)
- phases: 5 draft (draft)
+ phases: 5 draft
file that was removed is recreated
(this also tests that editor is not invoked if the commit message is
@@ -113,7 +113,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
backout of backout is as if nothing happened
@@ -128,7 +128,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 4 draft (draft)
+ phases: 4 draft
across branch
@@ -149,7 +149,7 @@
branch: default
commit: (clean)
update: 1 new changesets (update)
- phases: 2 draft (draft)
+ phases: 2 draft
should fail
@@ -166,7 +166,7 @@
branch: default
commit: (clean)
update: 1 new changesets, 2 branch heads (merge)
- phases: 3 draft (draft)
+ phases: 3 draft
should fail
@@ -179,7 +179,7 @@
branch: default
commit: (clean)
update: 1 new changesets, 2 branch heads (merge)
- phases: 3 draft (draft)
+ phases: 3 draft
backout with merge
@@ -197,7 +197,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
remove line 1
@@ -222,7 +222,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 5 draft (draft)
+ phases: 5 draft
check line 1 is back
@@ -251,7 +251,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
without --merge
$ hg backout -d '3 0' 1 --tool=true
@@ -269,7 +269,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
with --merge
$ hg backout --merge -d '3 0' 1 --tool=true
@@ -314,7 +314,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 5 draft (draft)
+ phases: 5 draft
backout of merge should fail
@@ -345,7 +345,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 6 draft (draft)
+ phases: 6 draft
$ hg rollback
repository tip rolled back to revision 4 (undo commit)
@@ -358,7 +358,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 5 draft (draft)
+ phases: 5 draft
$ hg backout -d '6 0' --parent 3 4 --tool=true
removing c
@@ -369,7 +369,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 6 draft (draft)
+ phases: 6 draft
$ cd ..
@@ -409,7 +409,7 @@
branch: branch2
commit: 1 removed
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
with --merge
(this also tests that editor is invoked if '--edit' is specified
@@ -440,7 +440,7 @@
branch: branch2
commit: 1 removed (merge)
update: (current)
- phases: 4 draft (draft)
+ phases: 4 draft
$ hg update -q -C 2
on branch2 with branch1 not merged, so file1 should still exist:
@@ -457,7 +457,7 @@
branch: branch2
commit: (clean)
update: 1 new changesets, 2 branch heads (merge)
- phases: 4 draft (draft)
+ phases: 4 draft
on branch2 with branch1 merged, so file1 should be gone:
@@ -476,7 +476,7 @@
branch: branch2
commit: (clean)
update: (current)
- phases: 5 draft (draft)
+ phases: 5 draft
on branch1, so no file1 and file2:
@@ -493,7 +493,7 @@
branch: branch1
commit: (clean)
update: (current)
- phases: 5 draft (draft)
+ phases: 5 draft
$ cd ..
@@ -573,7 +573,7 @@
branch: default
commit: 1 unresolved (clean)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
$ hg resolve --all --debug
picked tool 'internal:merge' for foo (binary False symlink False)
merging foo
@@ -591,7 +591,7 @@
branch: default
commit: 1 modified, 1 unknown
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
$ cat foo
one
two
--- a/tests/test-bisect.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-bisect.t Fri May 29 22:23:58 2015 +0200
@@ -190,7 +190,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 32 draft (draft)
+ phases: 32 draft
$ hg bisect -g 1
Testing changeset 16:a2e6ea4973e9 (30 changesets remaining, ~4 tests)
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-bookmarks.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-bookmarks.t Fri May 29 22:23:58 2015 +0200
@@ -393,7 +393,7 @@
bookmarks: *Z Y x y
commit: (clean)
update: 1 new changesets, 2 branch heads (merge)
- phases: 3 draft (draft)
+ phases: 3 draft
test id
@@ -539,7 +539,7 @@
bookmarks: *Z Y x y
commit: 1 added, 1 unknown (new branch head)
update: 2 new changesets (update)
- phases: 5 draft (draft)
+ phases: 5 draft
$ hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
updating bookmark Z
--- a/tests/test-commit-amend.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-commit-amend.t Fri May 29 22:23:58 2015 +0200
@@ -72,7 +72,7 @@
branch: default
commit: 1 added, 1 unknown
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
$ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
transaction abort!
rollback completed
@@ -84,7 +84,7 @@
branch: default
commit: 1 added, 1 unknown
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
Add new file:
$ hg ci --amend -m 'amend base1 new file'
--- a/tests/test-commit-interactive.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-commit-interactive.t Fri May 29 22:23:58 2015 +0200
@@ -81,7 +81,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
Rename empty file
--- a/tests/test-copy.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-copy.t Fri May 29 22:23:58 2015 +0200
@@ -19,7 +19,7 @@
branch: default
commit: 1 copied
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
$ hg --debug commit -m "2"
committing files:
b
--- a/tests/test-histedit-edit.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-histedit-edit.t Fri May 29 22:23:58 2015 +0200
@@ -246,7 +246,7 @@
branch: default
commit: 1 added (new branch head)
update: 1 new changesets (update)
- phases: 7 draft (draft)
+ phases: 7 draft
hist: 1 remaining (histedit --continue)
(test also that editor is invoked if histedit is continued for
--- a/tests/test-histedit-no-change.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-histedit-no-change.t Fri May 29 22:23:58 2015 +0200
@@ -183,7 +183,7 @@
branch: default
commit: 1 added, 1 unknown (new branch head)
update: 6 new changesets (update)
- phases: 7 draft (draft)
+ phases: 7 draft
hist: 2 remaining (histedit --continue)
$ hg histedit --abort 2>&1 | fixbundle
--- a/tests/test-import.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-import.t Fri May 29 22:23:58 2015 +0200
@@ -990,7 +990,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
$ hg diff --git -c tip
diff --git a/lib/place-holder b/lib/place-holder
--- a/tests/test-largefiles-misc.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-largefiles-misc.t Fri May 29 22:23:58 2015 +0200
@@ -228,7 +228,7 @@
branch: default
commit: 1 subrepos
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
$ hg st
$ hg st -S
A subrepo/large.txt
@@ -246,7 +246,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
$ echo "rev 2" > subrepo/large.txt
$ hg st -S
M subrepo/large.txt
@@ -256,7 +256,7 @@
branch: default
commit: 1 subrepos
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
$ hg ci -m "this commit should fail without -S"
abort: uncommitted changes in subrepository 'subrepo'
(use --subrepos for recursive commit)
@@ -570,7 +570,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
largefiles: (no remote repo)
check messages when there is no files to upload:
@@ -585,7 +585,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
largefiles: (no files to upload)
$ hg -R clone2 outgoing --large
comparing with $TESTTMP/issue3651/src (glob)
@@ -613,7 +613,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
largefiles: 1 entities for 1 files to upload
$ hg -R clone2 outgoing --large
comparing with $TESTTMP/issue3651/src (glob)
@@ -649,7 +649,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
largefiles: 1 entities for 3 files to upload
$ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
comparing with $TESTTMP/issue3651/src (glob)
@@ -699,7 +699,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 6 draft (draft)
+ phases: 6 draft
largefiles: 3 entities for 3 files to upload
$ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
comparing with $TESTTMP/issue3651/src (glob)
@@ -758,7 +758,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 6 draft (draft)
+ phases: 6 draft
largefiles: 2 entities for 1 files to upload
$ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
comparing with $TESTTMP/issue3651/src (glob)
--- a/tests/test-largefiles.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-largefiles.t Fri May 29 22:23:58 2015 +0200
@@ -71,7 +71,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
largefiles: (no remote repo)
Commit preserved largefile contents.
@@ -1004,7 +1004,7 @@
branch: default
commit: (clean)
update: 7 new changesets (update)
- phases: 8 draft (draft)
+ phases: 8 draft
$ rm "${USERCACHE}"/*
$ hg clone --all-largefiles -u 1 a a-clone1
@@ -1027,7 +1027,7 @@
branch: default
commit: (clean)
update: 6 new changesets (update)
- phases: 8 draft (draft)
+ phases: 8 draft
$ rm "${USERCACHE}"/*
$ hg clone --all-largefiles -U a a-clone-u
@@ -1037,7 +1037,7 @@
branch: default
commit: (clean)
update: 8 new changesets (update)
- phases: 8 draft (public)
+ phases: 8 draft
Show computed destination directory:
--- a/tests/test-merge1.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-merge1.t Fri May 29 22:23:58 2015 +0200
@@ -40,7 +40,7 @@
branch: default
commit: (interrupted update)
update: 1 new changesets (update)
- phases: 2 draft (draft)
+ phases: 2 draft
$ rmdir b
$ hg up
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -50,7 +50,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
Prepare a basic merge
--- a/tests/test-obsolete.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-obsolete.t Fri May 29 22:23:58 2015 +0200
@@ -168,7 +168,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
remote: 3 outgoing
$ hg summary --remote --hidden
@@ -177,7 +177,7 @@
branch: default
commit: (clean)
update: 3 new changesets, 4 branch heads (merge)
- phases: 6 draft (draft)
+ phases: 6 draft
remote: 3 outgoing
check that various commands work well with filtering
--- a/tests/test-phases.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-phases.t Fri May 29 22:23:58 2015 +0200
@@ -254,14 +254,13 @@
branch: default
commit: (clean)
update: 5 new changesets (update)
- phases: (public)
$ hg summary -R initialrepo
parent: 7:17a481b3bccb tip
merge B' and E
branch: default
- commit: (clean)
+ commit: (clean) (secret)
update: 1 new changesets, 2 branch heads (merge)
- phases: 3 draft, 3 secret (secret)
+ phases: 3 draft, 3 secret
$ hg summary -R initialrepo --quiet
parent: 7:17a481b3bccb tip
update: 1 new changesets, 2 branch heads (merge)
--- a/tests/test-rebase-abort.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-rebase-abort.t Fri May 29 22:23:58 2015 +0200
@@ -321,4 +321,4 @@
branch: default
commit: (clean)
update: 1 new changesets, 2 branch heads (merge)
- phases: 4 draft (draft)
+ phases: 4 draft
--- a/tests/test-rebase-parameters.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-rebase-parameters.t Fri May 29 22:23:58 2015 +0200
@@ -476,7 +476,7 @@
branch: default
commit: 1 modified, 1 unresolved (merge)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
rebase: 0 rebased, 1 remaining (rebase --continue)
$ hg resolve -l
--- a/tests/test-rename.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-rename.t Fri May 29 22:23:58 2015 +0200
@@ -20,7 +20,7 @@
branch: default
commit: 1 renamed
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
$ hg status -C
A d2/c
d1/d11/a1
--- a/tests/test-revert.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-revert.t Fri May 29 22:23:58 2015 +0200
@@ -360,7 +360,7 @@
branch: default
commit: 2 modified, 1 removed (merge)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
clarifies who added what
--- a/tests/test-shelve.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-shelve.t Fri May 29 22:23:58 2015 +0200
@@ -783,7 +783,7 @@
bookmarks: *test
commit: 2 unknown (clean)
update: (current)
- phases: 5 draft (draft)
+ phases: 5 draft
$ hg shelve --delete --stat
abort: options '--delete' and '--stat' may not be used together
--- a/tests/test-strip.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-strip.t Fri May 29 22:23:58 2015 +0200
@@ -526,7 +526,7 @@
branch: default
commit: 1 modified, 1 unknown, 1 unresolved
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
mq: 3 unapplied
$ echo c > b
@@ -554,7 +554,7 @@
branch: default
commit: 1 modified, 1 unknown
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
mq: 3 unapplied
Strip adds, removes, modifies with --keep
--- a/tests/test-subrepo-svn.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-subrepo-svn.t Fri May 29 22:23:58 2015 +0200
@@ -72,7 +72,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
$ hg ci -moops
nothing changed
[1]
@@ -97,7 +97,7 @@
branch: default
commit: 1 modified, 1 subrepos
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
$ hg commit --subrepos -m 'Message!' | grep -v Updating
committing subrepository s
Sending*s/alpha (glob)
@@ -138,7 +138,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
$ echo a > s/a
--- a/tests/test-subrepo.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-subrepo.t Fri May 29 22:23:58 2015 +0200
@@ -38,7 +38,7 @@
branch: default
commit: 1 added, 1 subrepos
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
$ hg ci -m1
test handling .hgsubstate "added" explicitly.
@@ -84,7 +84,7 @@
branch: default
commit: 1 subrepos
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
$ hg co -C 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg sum
@@ -93,7 +93,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
commands that require a clean repo should respect subrepos
@@ -116,7 +116,7 @@
branch: default
commit: 1 subrepos
update: (current)
- phases: 2 draft (draft)
+ phases: 2 draft
$ hg ci -m2
committing subrepository s
committing subrepository s/ss (glob)
@@ -126,7 +126,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 3 draft (draft)
+ phases: 3 draft
test handling .hgsubstate "modified" explicitly.
--- a/tests/test-url-rev.t Mon May 25 16:48:55 2015 -0700
+++ b/tests/test-url-rev.t Fri May 29 22:23:58 2015 +0200
@@ -101,7 +101,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 4 draft (draft)
+ phases: 4 draft
remote: 2 outgoing
$ hg -q outgoing '../clone#foo'
2:faba9097cad4
@@ -111,7 +111,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 4 draft (draft)
+ phases: 4 draft
remote: 1 outgoing
$ hg -q --cwd ../clone incoming '../repo#foo'
@@ -284,7 +284,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
remote: 1 outgoing
$ hg summary --remote --config paths.default='../clone#foo' --config paths.default-push='../clone'
@@ -293,7 +293,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
remote: 2 outgoing
$ hg summary --remote --config paths.default='../clone' --config paths.default-push='../clone#foo'
@@ -302,7 +302,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
remote: 1 outgoing
$ hg clone -q -r 0 . ../another
@@ -316,7 +316,7 @@
branch: default
commit: (clean)
update: (current)
- phases: 1 draft (draft)
+ phases: 1 draft
remote: 1 outgoing
$ cd ..