fetch: use update rather than clean when updating (issue3246) stable
authorMatt Mackall <mpm@selenic.com>
Mon, 06 Feb 2012 16:35:14 -0600
branchstable
changeset 16091 f6e9c731dd3f
parent 16089 2e8f4b82c551
child 16098 c6c9b83a1e8a
fetch: use update rather than clean when updating (issue3246) We already verify the working directory is "clean" before starting so there's no advantage to clobbering the working directory.
hgext/fetch.py
--- a/hgext/fetch.py	Mon Feb 06 21:17:50 2012 +0100
+++ b/hgext/fetch.py	Mon Feb 06 16:35:14 2012 -0600
@@ -85,7 +85,7 @@
         newchildren = repo.changelog.nodesbetween([parent], newheads)[2]
         if len(newheads) == 1 and len(newchildren):
             if newchildren[0] != parent:
-                return hg.clean(repo, newchildren[0])
+                return hg.update(repo, newchildren[0])
             else:
                 return 0