[PATCH 2 of 2] localrepo: show headline notes in commitctx before showing filenames

Mads Kiilerich mads at kiilerich.com
Tue Jan 6 21:59:01 CST 2015


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1397820800 -7200
#      Fri Apr 18 13:33:20 2014 +0200
# Node ID 9af7c182d449a18fc79bfe130b37c4cfe809df7f
# Parent  4f0c879d0aade3702856305fac3ecfd90fcdfd6c
localrepo: show headline notes in commitctx before showing filenames

commitctx already showed notes with filenames but didn't provide any context.
It is just as relevant to know when manifest or changelog is committed.

So, in addition to filenames, also show headlines 'committing files:',
'committing manifest' and 'committing changelog'.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1432,6 +1432,7 @@ class localrepository(object):
                 changed = []
                 removed = list(ctx.removed())
                 linkrev = len(self)
+                self.ui.note(_("committing files:\n"))
                 for f in sorted(ctx.modified() + ctx.added()):
                     self.ui.note(f + "\n")
                     try:
@@ -1453,6 +1454,7 @@ class localrepository(object):
                         raise
 
                 # update manifest
+                self.ui.note(_("committing manifest\n"))
                 removed = [f for f in sorted(removed) if f in m1 or f in m2]
                 drop = [f for f in removed if f in m]
                 for f in drop:
@@ -1466,6 +1468,7 @@ class localrepository(object):
                 files = []
 
             # update changelog
+            self.ui.note(_("committing changelog\n"))
             self.changelog.delayupdate(tr)
             n = self.changelog.add(mn, files, ctx.description(),
                                    trp, p1.node(), p2.node(),
diff --git a/tests/test-addremove.t b/tests/test-addremove.t
--- a/tests/test-addremove.t
+++ b/tests/test-addremove.t
@@ -6,8 +6,11 @@
   adding dir/bar
   adding foo
   $ hg -v commit -m "add 1"
+  committing files:
   dir/bar
   foo
+  committing manifest
+  committing changelog
   committed changeset 0:6f7f953567a2
   $ cd dir/
   $ touch ../foo_2 bar_2
@@ -15,8 +18,11 @@
   adding dir/bar_2
   adding foo_2
   $ hg -v commit -m "add 2"
+  committing files:
   dir/bar_2
   foo_2
+  committing manifest
+  committing changelog
   committed changeset 1:e65414bf35c5
   $ cd ..
   $ hg forget foo
diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -106,7 +106,10 @@ No changes, just a different message:
   $ hg ci -v --amend -m 'no changes, new message'
   amending changeset 74609c7f506e
   copying changeset 74609c7f506e to ad120869acf0
+  committing files:
   a
+  committing manifest
+  committing changelog
   stripping amended changeset 74609c7f506e
   1 changesets found
   uncompressed size of bundle content:
@@ -190,7 +193,10 @@ at first, test saving last-message.txt
   $ hg commit --amend -v -m "message given from command line"
   amending changeset 5f357c7560ab
   copying changeset 5f357c7560ab to ad120869acf0
+  committing files:
   a
+  committing manifest
+  committing changelog
   running hook pretxncommit.test-saving-last-message: false
   transaction abort!
   rollback completed
@@ -212,7 +218,10 @@ at first, test saving last-message.txt
   HG: user: foo
   HG: branch 'default'
   HG: changed a
+  committing files:
   a
+  committing manifest
+  committing changelog
   running hook pretxncommit.test-saving-last-message: false
   transaction abort!
   rollback completed
@@ -241,7 +250,10 @@ then, test editing custom commit message
   HG: user: foo
   HG: branch 'default'
   HG: changed a
+  committing files:
   a
+  committing manifest
+  committing changelog
   stripping amended changeset 5f357c7560ab
   1 changesets found
   uncompressed size of bundle content:
@@ -266,7 +278,10 @@ Same, but with changes in working dir (d
   $ echo a >> a
   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
   amending changeset 7ab3bf440b54
+  committing files:
   a
+  committing manifest
+  committing changelog
   copying changeset a0ea9b1a4c8c to ad120869acf0
   another precious commit message
   
@@ -277,7 +292,10 @@ Same, but with changes in working dir (d
   HG: user: foo
   HG: branch 'default'
   HG: changed a
+  committing files:
   a
+  committing manifest
+  committing changelog
   stripping intermediate changeset a0ea9b1a4c8c
   stripping amended changeset 7ab3bf440b54
   2 changesets found
diff --git a/tests/test-commit.t b/tests/test-commit.t
--- a/tests/test-commit.t
+++ b/tests/test-commit.t
@@ -50,7 +50,10 @@ commit added file that has been deleted
   $ hg add
   adding dir/file (glob)
   $ hg -v commit -m commit-9 dir
+  committing files:
   dir/file
+  committing manifest
+  committing changelog
   committed changeset 2:d2a76177cb42
 
   $ echo > dir.file
@@ -71,7 +74,10 @@ commit added file that has been deleted
   abort: dir2: no match under directory!
   [255]
   $ hg -v commit -m commit-13 ../dir
+  committing files:
   dir/file
+  committing manifest
+  committing changelog
   committed changeset 3:1cd62a2d8db5
   $ cd ..
 
@@ -92,7 +98,10 @@ commit added file that has been deleted
   [255]
   $ echo >> dir/file
   $ hg -v commit -m commit-17 dir/file
+  committing files:
   dir/file
+  committing manifest
+  committing changelog
   committed changeset 4:49176991390e
 
 An empty date was interpreted as epoch origin
diff --git a/tests/test-convert-svn-encoding.t b/tests/test-convert-svn-encoding.t
--- a/tests/test-convert-svn-encoding.t
+++ b/tests/test-convert-svn-encoding.t
@@ -52,6 +52,7 @@ Convert while testing all possible outpu
   5 init projA
   source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk at 1
   converting: 0/6 revisions (0.00%)
+  committing changelog
   4 hello
   source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk at 2
   converting: 1/6 revisions (16.67%)
@@ -59,10 +60,13 @@ Convert while testing all possible outpu
   scanning paths: /trunk/\xc3\xa0 0/3 (0.00%) (esc)
   scanning paths: /trunk/\xc3\xa0/e\xcc\x81 1/3 (33.33%) (esc)
   scanning paths: /trunk/\xc3\xa9 2/3 (66.67%) (esc)
+  committing files:
   \xc3\xa0/e\xcc\x81 (esc)
   getting files: \xc3\xa0/e\xcc\x81 1/2 (50.00%) (esc)
   \xc3\xa9 (esc)
   getting files: \xc3\xa9 2/2 (100.00%) (esc)
+  committing manifest
+  committing changelog
   3 copy files
   source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk at 3
   converting: 2/6 revisions (33.33%)
@@ -80,12 +84,15 @@ Convert while testing all possible outpu
   mark /trunk/\xc3\xb9 came from \xc3\xa0:2 (esc)
   getting files: \xc3\xa0/e\xcc\x81 1/4 (25.00%) (esc)
   getting files: \xc3\xa9 2/4 (50.00%) (esc)
+  committing files:
   \xc3\xa8 (esc)
   getting files: \xc3\xa8 3/4 (75.00%) (esc)
    \xc3\xa8: copy \xc3\xa9:6b67ccefd5ce6de77e7ead4f5292843a0255329f (esc)
   \xc3\xb9/e\xcc\x81 (esc)
   getting files: \xc3\xb9/e\xcc\x81 4/4 (100.00%) (esc)
    \xc3\xb9/e\xcc\x81: copy \xc3\xa0/e\xcc\x81:a9092a3d84a37b9993b5c73576f6de29b7ea50f6 (esc)
+  committing manifest
+  committing changelog
   2 remove files
   source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk at 4
   converting: 3/6 revisions (50.00%)
@@ -99,22 +106,30 @@ Convert while testing all possible outpu
   reparent to file://*/svn-repo/trunk (glob)
   getting files: \xc3\xa8 1/2 (50.00%) (esc)
   getting files: \xc3\xb9/e\xcc\x81 2/2 (100.00%) (esc)
+  committing files:
+  committing manifest
+  committing changelog
   1 branch to branch?
   source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?@5
   converting: 4/6 revisions (66.67%)
   reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
   scanning paths: /branches/branch\xc3\xa9 0/1 (0.00%) (esc)
+  committing changelog
   0 branch to branch?e
   source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?e at 6
   converting: 5/6 revisions (83.33%)
   reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
   scanning paths: /branches/branch\xc3\xa9e 0/1 (0.00%) (esc)
+  committing changelog
   reparent to file://*/svn-repo (glob)
   reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
   reparent to file://*/svn-repo (glob)
   reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
   updating tags
+  committing files:
   .hgtags
+  committing manifest
+  committing changelog
   run hg sink post-conversion action
   $ cd A-hg
   $ hg up
diff --git a/tests/test-copy.t b/tests/test-copy.t
--- a/tests/test-copy.t
+++ b/tests/test-copy.t
@@ -20,8 +20,11 @@
   commit: 1 copied
   update: (current)
   $ hg --debug commit -m "2"
+  committing files:
   b
    b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
+  committing manifest
+  committing changelog
   committed changeset 1:93580a2c28a50a56f63526fb305067e6fbf739c4
 
 we should see two history entries
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -159,7 +159,10 @@ Graft out of order, skipping a merge and
   merging b and a to b
   my b at ef0ef43d49e7+ other a at 5d205f8b35b6 ancestor a at 68795b066622
    premerge successful
+  committing files:
   b
+  committing manifest
+  committing changelog
   grafting 5:97f8bfe72746 "5"
     searching for copies back to rev 1
   resolving manifests
@@ -169,7 +172,10 @@ Graft out of order, skipping a merge and
   getting e
   updating: e 1/1 files (100.00%)
    b: remote unchanged -> k
+  committing files:
   e
+  committing manifest
+  committing changelog
   grafting 4:9c233e8e184d "4"
     searching for copies back to rev 1
   resolving manifests
diff --git a/tests/test-hook.t b/tests/test-hook.t
--- a/tests/test-hook.t
+++ b/tests/test-hook.t
@@ -511,7 +511,10 @@ make sure --traceback works
   Automatically installed hook
   $ echo >> foo
   $ hg ci --debug -d '0 0' -m 'change foo'
+  committing files:
   foo
+  committing manifest
+  committing changelog
   calling hook commit.auto: hgext_hookext.autohook
   Automatically installed hook
   committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708
diff --git a/tests/test-import.t b/tests/test-import.t
--- a/tests/test-import.t
+++ b/tests/test-import.t
@@ -411,11 +411,17 @@ patches: import patch1 patch2; rollback
   $ hg --cwd b import -v ../patch1 ../patch2
   applying ../patch1
   patching file a
+  committing files:
   a
+  committing manifest
+  committing changelog
   created 1d4bd90af0e4
   applying ../patch2
   patching file a
+  committing files:
   a
+  committing manifest
+  committing changelog
   created 6d019af21222
   $ hg --cwd b rollback
   repository tip rolled back to revision 0 (undo import)
diff --git a/tests/test-issue1175.t b/tests/test-issue1175.t
--- a/tests/test-issue1175.t
+++ b/tests/test-issue1175.t
@@ -28,9 +28,12 @@ http://mercurial.selenic.com/bts/issue11
   $ hg ci -Am4 a
 
   $ hg ci --debug --traceback -Am5 b
+  committing files:
   b
    b: searching for copy revision for a
    b: copy a:b80de5d138758541c5f05265ad144ab9fa86d1db
+  committing manifest
+  committing changelog
   committed changeset 5:732aafbecb501a198b3cc9323ad3899ff04ccf95
 
   $ hg verify
diff --git a/tests/test-keyword.t b/tests/test-keyword.t
--- a/tests/test-keyword.t
+++ b/tests/test-keyword.t
@@ -135,8 +135,11 @@ Interrupted commit should not change sta
 Commit with several checks
 
   $ hg --debug commit -mabsym -u 'User Name <user at example.com>'
+  committing files:
   a
   b
+  committing manifest
+  committing changelog
   overwriting a expanding keywords
   running hook commit.test: cp a hooktest
   committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
@@ -475,7 +478,10 @@ record added file alone
   new file mode 100644
   examine changes to 'r'? [Ynesfdaq?] y
   
+  committing files:
   r
+  committing manifest
+  committing changelog
   committed changeset 3:82a2f715724d
   overwriting r expanding keywords
  - status call required for dirstate.normallookup() check
@@ -500,7 +506,10 @@ record added keyword ignored file
   new file mode 100644
   examine changes to 'i'? [Ynesfdaq?] y
   
+  committing files:
   i
+  committing manifest
+  committing changelog
   committed changeset 3:9f40ceb5a072
   $ cat i
   $Id$
@@ -585,8 +594,11 @@ Copy and show added kwfiles
 Commit and show expansion in original and copy
 
   $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user at example.com>'
+  committing files:
   c
    c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
+  committing manifest
+  committing changelog
   overwriting c expanding keywords
   committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
   $ cat a c
@@ -756,7 +768,10 @@ Interrupted commit should not change sta
 Commit with multi-line message and custom expansion
 
   $ hg --debug commit -l log -d '2 0' -u 'User Name <user at example.com>'
+  committing files:
   a
+  committing manifest
+  committing changelog
   overwriting a expanding keywords
   committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
   $ rm log
@@ -798,6 +813,9 @@ remove with status checks
   $ hg debugrebuildstate
   $ hg remove a
   $ hg --debug commit -m rma
+  committing files:
+  committing manifest
+  committing changelog
   committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
   $ hg status
   ? c
@@ -868,7 +886,10 @@ Imported patch should not be rejected
   >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
   >>> open('a', 'wb').write(text)
   $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user at example.com>'
+  committing files:
   a
+  committing manifest
+  committing changelog
   overwriting a expanding keywords
   committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
   $ hg export -o ../rejecttest.diff tip
@@ -908,8 +929,11 @@ kwexpand x/a should abort
   [255]
   $ cd x
   $ hg --debug commit -m xa -d '3 0' -u 'User Name <user at example.com>'
+  committing files:
   x/a
    x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
+  committing manifest
+  committing changelog
   overwriting x/a expanding keywords
   committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
   $ cat a
diff --git a/tests/test-mq-guards.t b/tests/test-mq-guards.t
--- a/tests/test-mq-guards.t
+++ b/tests/test-mq-guards.t
@@ -270,7 +270,10 @@ should push b.patch
   applying c.patch
   patching file c
   adding c
+  committing files:
   c
+  committing manifest
+  committing changelog
   now at: c.patch
 
 guards in series file: +1 +2 -3
diff --git a/tests/test-mq-qpush-fail.t b/tests/test-mq-qpush-fail.t
--- a/tests/test-mq-qpush-fail.t
+++ b/tests/test-mq-qpush-fail.t
@@ -264,7 +264,10 @@ test qpush --force and backup files
   applying p2
   saving current version of a as a.orig
   patching file a
+  committing files:
   a
+  committing manifest
+  committing changelog
   applying p3
   saving current version of b as b.orig
   saving current version of d as d.orig
@@ -277,7 +280,10 @@ test qpush --force and backup files
   file e already exists
   1 out of 1 hunks FAILED -- saving rejects to file e.rej
   patch failed to apply
+  committing files:
   b
+  committing manifest
+  committing changelog
   patch failed, rejects left in working dir
   errors during apply, please fix and refresh p3
   [2]
@@ -302,7 +308,10 @@ test qpush --force --no-backup
   $ hg qpush --force --no-backup --verbose
   applying p2
   patching file a
+  committing files:
   a
+  committing manifest
+  committing changelog
   now at: p2
   $ test -f a.orig && echo 'error: backup with --no-backup'
   [1]
@@ -316,7 +325,10 @@ test qgoto --force --no-backup
   $ hg qgoto --force --no-backup p2 --verbose
   applying p2
   patching file a
+  committing files:
   a
+  committing manifest
+  committing changelog
   now at: p2
   $ test -f a.orig && echo 'error: backup with --no-backup'
   [1]
diff --git a/tests/test-mq-symlinks.t b/tests/test-mq-symlinks.t
--- a/tests/test-mq-symlinks.t
+++ b/tests/test-mq-symlinks.t
@@ -47,7 +47,10 @@ test updating a symlink
   $ hg qpush --debug
   applying updatelink
   patching file a
+  committing files:
   a
+  committing manifest
+  committing changelog
   now at: updatelink
   $ "$TESTDIR/readlink.py" a
   a -> c
diff --git a/tests/test-mq.t b/tests/test-mq.t
--- a/tests/test-mq.t
+++ b/tests/test-mq.t
@@ -1400,7 +1400,10 @@ apply force, should discard changes in h
   applying empty
   saving current version of hello.txt as hello.txt.orig
   patching file hello.txt
+  committing files:
   hello.txt
+  committing manifest
+  committing changelog
   now at: empty
   $ hg st
   M bye.txt
diff --git a/tests/test-patch-offset.t b/tests/test-patch-offset.t
--- a/tests/test-patch-offset.t
+++ b/tests/test-patch-offset.t
@@ -68,7 +68,10 @@ import patch
   Hunk #1 succeeded at 43 (offset 34 lines).
   Hunk #2 succeeded at 87 (offset 34 lines).
   Hunk #3 succeeded at 109 (offset 34 lines).
+  committing files:
   a
+  committing manifest
+  committing changelog
   created 189885cecb41
 
 compare imported changes against reference file
diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t
--- a/tests/test-rebase-conflicts.t
+++ b/tests/test-rebase-conflicts.t
@@ -245,7 +245,10 @@ Check that the right ancestors is used w
    f1.txt: remote is newer -> g
   getting f1.txt
   updating: f1.txt 1/1 files (100.00%)
+  committing files:
   f1.txt
+  committing manifest
+  committing changelog
   rebased as 19c888675e13
   rebasing 10:2f2496ddf49d "merge" (tip)
   rebasing: 10:2f2496ddf49d 6/6 changesets (100.00%)
@@ -261,7 +264,10 @@ Check that the right ancestors is used w
    f1.txt: remote is newer -> g
   getting f1.txt
   updating: f1.txt 1/1 files (100.00%)
+  committing files:
   f1.txt
+  committing manifest
+  committing changelog
   rebased as 2a7f09cac94c
   rebase merging completed
   update back to initial working directory parent
diff --git a/tests/test-rebase-mq-skip.t b/tests/test-rebase-mq-skip.t
--- a/tests/test-rebase-mq-skip.t
+++ b/tests/test-rebase-mq-skip.t
@@ -56,7 +56,10 @@ already has one local mq patch
   getting r1
   resolving manifests
   getting p0
+  committing files:
   p0
+  committing manifest
+  committing changelog
   rebasing 3:148775c71080 "P1" (p1.patch qtip)
   resolving manifests
   note: rebase of 3:148775c71080 created no changes to commit
diff --git a/tests/test-rebase-newancestor.t b/tests/test-rebase-newancestor.t
--- a/tests/test-rebase-newancestor.t
+++ b/tests/test-rebase-newancestor.t
@@ -291,7 +291,10 @@ rebase of merge of ancestors
   end of auction
   
   getting other
+  committing files:
   other
+  committing manifest
+  committing changelog
   rebase merging completed
   1 changesets found
   uncompressed size of bundle content:


More information about the Mercurial-devel mailing list