Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 2175:b2ae81a7df29
Make hg update more verbose by default (issue12)
(including small changes to revert and backout to not show these stats
with the exception of backout --merge)
Show update stats (unless -q), e.g.:
K files updated, L files merged, M files removed, N files unresolved
Inform the user what to do after a merge:
(branch merge, don't forget to commit)
Inform the user what to do if a branch merge failed:
There are unresolved merges, you can redo the full merge using:
hg update -C X
hg merge Y
Inform the user what to do if a working directory merge failed:
There are unresolved merges with locally modified files.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Tue, 02 May 2006 18:44:02 +0200 |
parents | f5c2c6e69fd7 |
children | b67fcd91dd1b |
comparison
equal
deleted
inserted
replaced
2174:3044a3fdae76 | 2175:b2ae81a7df29 |
---|---|
1538 self.hook("incoming", node=hex(self.changelog.node(i))) | 1538 self.hook("incoming", node=hex(self.changelog.node(i))) |
1539 | 1539 |
1540 return newheads - oldheads + 1 | 1540 return newheads - oldheads + 1 |
1541 | 1541 |
1542 def update(self, node, allow=False, force=False, choose=None, | 1542 def update(self, node, allow=False, force=False, choose=None, |
1543 moddirstate=True, forcemerge=False, wlock=None): | 1543 moddirstate=True, forcemerge=False, wlock=None, show_stats=True): |
1544 pl = self.dirstate.parents() | 1544 pl = self.dirstate.parents() |
1545 if not force and pl[1] != nullid: | 1545 if not force and pl[1] != nullid: |
1546 self.ui.warn(_("aborting: outstanding uncommitted merges\n")) | 1546 self.ui.warn(_("aborting: outstanding uncommitted merges\n")) |
1547 return 1 | 1547 return 1 |
1548 | 1548 |
1806 self.dirstate.forget(remove) | 1806 self.dirstate.forget(remove) |
1807 | 1807 |
1808 if moddirstate: | 1808 if moddirstate: |
1809 self.dirstate.setparents(p1, p2) | 1809 self.dirstate.setparents(p1, p2) |
1810 | 1810 |
1811 stat = ((len(get), _("updated")), | 1811 if show_stats: |
1812 (len(merge) - len(failedmerge), _("merged")), | 1812 stats = ((len(get), _("updated")), |
1813 (len(remove), _("removed")), | 1813 (len(merge) - len(failedmerge), _("merged")), |
1814 (len(failedmerge), _("unresolved"))) | 1814 (len(remove), _("removed")), |
1815 note = ", ".join([_("%d files %s") % s for s in stat]) | 1815 (len(failedmerge), _("unresolved"))) |
1816 self.ui.note("%s\n" % note) | 1816 note = ", ".join([_("%d files %s") % s for s in stats]) |
1817 if moddirstate and branch_merge: | 1817 self.ui.status("%s\n" % note) |
1818 self.ui.note(_("(branch merge, don't forget to commit)\n")) | 1818 if moddirstate: |
1819 if branch_merge: | |
1820 if failedmerge: | |
1821 self.ui.status(_("There are unresolved merges," | |
1822 " you can redo the full merge using:\n" | |
1823 " hg update -C %s\n" | |
1824 " hg merge %s\n" | |
1825 % (self.changelog.rev(p1), | |
1826 self.changelog.rev(p2)))) | |
1827 else: | |
1828 self.ui.status(_("(branch merge, don't forget to commit)\n")) | |
1829 elif failedmerge: | |
1830 self.ui.status(_("There are unresolved merges with" | |
1831 " locally modified files.\n")) | |
1819 | 1832 |
1820 return err | 1833 return err |
1821 | 1834 |
1822 def merge3(self, fn, my, other, p1, p2): | 1835 def merge3(self, fn, my, other, p1, p2): |
1823 """perform a 3-way merge in the working directory""" | 1836 """perform a 3-way merge in the working directory""" |