Mercurial > hg-stable
changeset 1922:6d50d6189269
ui: output the number of file updated/merged/removed/... on update
add a note for people to remember commiting after a merge.
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Mon, 13 Mar 2006 08:56:59 +0100 |
parents | acce3f7e1779 |
children | 82995896d5af |
files | mercurial/localrepo.py tests/test-filebranch.out tests/test-flags.out tests/test-merge7.out tests/test-up-local-change.out tests/test-update-reverse.out |
diffstat | 6 files changed, 24 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Sun Mar 12 20:34:09 2006 +0100 +++ b/mercurial/localrepo.py Mon Mar 13 08:56:59 2006 +0100 @@ -1634,6 +1634,7 @@ self.dirstate.update([f], 'n') # merge the tricky bits + failedmerge = [] files = merge.keys() files.sort() xp1 = hex(p1) @@ -1644,6 +1645,7 @@ ret = self.merge3(f, my, other, xp1, xp2) if ret: err = True + failedmerge.append(f) util.set_exec(self.wjoin(f), flag) if moddirstate: if branch_merge: @@ -1677,6 +1679,16 @@ if moddirstate: self.dirstate.setparents(p1, p2) + + stat = ((len(get), _("updated")), + (len(merge) - len(failedmerge), _("merged")), + (len(remove), _("removed")), + (len(failedmerge), _("unresolved"))) + note = ", ".join([_("%d files %s") % s for s in stat]) + self.ui.note("%s\n" % note) + if moddirstate and branch_merge: + self.ui.note(_("(branch merge, don't forget to commit)\n")) + return err def merge3(self, fn, my, other, p1, p2):
--- a/tests/test-filebranch.out Sun Mar 12 20:34:09 2006 +0100 +++ b/tests/test-filebranch.out Mon Mar 13 08:56:59 2006 +0100 @@ -19,6 +19,8 @@ getting bar merging foo resolving foo +1 files updated, 1 files merged, 0 files removed, 0 files unresolved +(branch merge, don't forget to commit) we shouldn't have anything but foo in merge state here m 644 3 foo main: we should have a merge here
--- a/tests/test-flags.out Sun Mar 12 20:34:09 2006 +0100 +++ b/tests/test-flags.out Mon Mar 13 08:56:59 2006 +0100 @@ -44,5 +44,7 @@ resolving manifests merging a resolving a +0 files updated, 1 files merged, 0 files removed, 0 files unresolved +(branch merge, don't forget to commit) -rwxr-x--- -rwxr-x---
--- a/tests/test-merge7.out Sun Mar 12 20:34:09 2006 +0100 +++ b/tests/test-merge7.out Mon Mar 13 08:56:59 2006 +0100 @@ -24,6 +24,8 @@ resolving test.txt file test.txt: my fc3148072371 other d40249267ae3 ancestor 8fe46a3eb557 merging test.txt failed! +0 files updated, 0 files merged, 0 files removed, 1 files unresolved +(branch merge, don't forget to commit) one <<<<<<< two-point-five
--- a/tests/test-up-local-change.out Sun Mar 12 20:34:09 2006 +0100 +++ b/tests/test-up-local-change.out Mon Mar 13 08:56:59 2006 +0100 @@ -21,6 +21,7 @@ merging a resolving a file a: my b789fdd96dc2 other d730145abbf9 ancestor b789fdd96dc2 +1 files updated, 1 files merged, 0 files removed, 0 files unresolved changeset: 1:1e71731e6fbb tag: tip user: test @@ -32,6 +33,7 @@ ancestor a0c8bcbbb45c local 1165e8bd193e remote a0c8bcbbb45c remote deleted b removing b +0 files updated, 0 files merged, 1 files removed, 0 files unresolved changeset: 0:c19d34741b0a user: test date: Thu Jan 1 00:00:00 1970 +0000 @@ -53,6 +55,7 @@ merging a resolving a file a: my b789fdd96dc2 other d730145abbf9 ancestor b789fdd96dc2 +1 files updated, 1 files merged, 0 files removed, 0 files unresolved changeset: 1:1e71731e6fbb tag: tip user: test @@ -113,6 +116,8 @@ merging b resolving b file b: my 1e88685f5dde other 61de8c7723ca ancestor 000000000000 +0 files updated, 2 files merged, 0 files removed, 0 files unresolved +(branch merge, don't forget to commit) changeset: 1:1e71731e6fbb user: test date: Thu Jan 1 00:00:00 1970 +0000