mercurial/hg.py
branchstable
changeset 17895 17c030014ddf
parent 17887 0e2846b2482c
child 17900 47fb48060e36
--- a/mercurial/hg.py	Wed Oct 31 03:59:28 2012 +0900
+++ b/mercurial/hg.py	Wed Oct 24 18:45:22 2012 +0200
@@ -459,9 +459,17 @@
     repo.ui.status(_("%d files updated, %d files merged, "
                      "%d files removed, %d files unresolved\n") % stats)
 
+def updaterepo(repo, node, overwrite):
+    """Update the working directory to node.
+
+    When overwrite is set, changes are clobbered, merged else
+
+    returns stats (see pydoc mercurial.merge.applyupdates)"""
+    return mergemod.update(repo, node, False, overwrite, None)
+
 def update(repo, node):
     """update the working directory to node, merging linear changes"""
-    stats = mergemod.update(repo, node, False, False, None)
+    stats = updaterepo(repo, node, False)
     _showstats(repo, stats)
     if stats[3]:
         repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
@@ -472,7 +480,7 @@
 
 def clean(repo, node, show_stats=True):
     """forcibly switch the working directory to node, clobbering changes"""
-    stats = mergemod.update(repo, node, False, True, None)
+    stats = updaterepo(repo, node, True)
     if show_stats:
         _showstats(repo, stats)
     return stats[3] > 0