cleanup: pass in overwrite flag to hg.updaterepo() as named argument
authorYuya Nishihara <yuya@tcha.org>
Sun, 01 Jul 2018 21:40:55 +0900
changeset 38508 39db5a01cd53
parent 38507 03e7ec8180f0
child 38509 5cfb01d5ff26
cleanup: pass in overwrite flag to hg.updaterepo() as named argument For clarity.
hgext/histedit.py
hgext/rebase.py
hgext/shelve.py
mercurial/commands.py
--- a/hgext/histedit.py	Sat Jun 30 07:23:02 2018 +0530
+++ b/hgext/histedit.py	Sun Jul 01 21:40:55 2018 +0900
@@ -784,7 +784,7 @@
 
     def finishfold(self, ui, repo, ctx, oldctx, newnode, internalchanges):
         parent = ctx.parents()[0].node()
-        hg.updaterepo(repo, parent, False)
+        hg.updaterepo(repo, parent, overwrite=False)
         ### prepare new commit data
         commitopts = {}
         commitopts['user'] = ctx.user()
@@ -815,7 +815,7 @@
                          skipprompt=self.skipprompt())
         if n is None:
             return ctx, []
-        hg.updaterepo(repo, n, False)
+        hg.updaterepo(repo, n, overwrite=False)
         replacements = [(oldctx.node(), (newnode,)),
                         (ctx.node(), (n,)),
                         (newnode, (n,)),
@@ -1177,7 +1177,7 @@
 
 def _finishhistedit(ui, repo, state, fm):
     """This action runs when histedit is finishing its session"""
-    hg.updaterepo(repo, state.parentctxnode, False)
+    hg.updaterepo(repo, state.parentctxnode, overwrite=False)
 
     mapping, tmpnodes, created, ntm = processreplacement(state)
     if mapping:
--- a/hgext/rebase.py	Sat Jun 30 07:23:02 2018 +0530
+++ b/hgext/rebase.py	Sun Jul 01 21:40:55 2018 +0900
@@ -623,7 +623,7 @@
             newwd = self.originalwd
         if newwd not in [c.rev() for c in repo[None].parents()]:
             ui.note(_("update back to initial working directory parent\n"))
-            hg.updaterepo(repo, newwd, False)
+            hg.updaterepo(repo, newwd, overwrite=False)
 
         collapsedas = None
         if self.collapsef and not self.keepf:
--- a/hgext/shelve.py	Sat Jun 30 07:23:02 2018 +0530
+++ b/hgext/shelve.py	Sun Jul 01 21:40:55 2018 +0900
@@ -709,7 +709,7 @@
             state.nodestoremove.append(newnode)
             shelvectx = repo[newnode]
 
-        hg.updaterepo(repo, pendingctx.node(), False)
+        hg.updaterepo(repo, pendingctx.node(), overwrite=False)
 
         if repo.vfs.exists('unshelverebasestate'):
             repo.vfs.rename('unshelverebasestate', 'rebasestate')
--- a/mercurial/commands.py	Sat Jun 30 07:23:02 2018 +0530
+++ b/mercurial/commands.py	Sun Jul 01 21:40:55 2018 +0900
@@ -2451,7 +2451,7 @@
 
         if cleanup:
             with repo.wlock(), repo.lock():
-                hg.updaterepo(repo, startctx.node(), True)
+                hg.updaterepo(repo, startctx.node(), overwrite=True)
                 # stripping the new nodes created
                 strippoints = [c.node() for c in repo.set("roots(%ld)",
                                                           newnodes)]
@@ -2460,7 +2460,7 @@
     if not cleanup:
         # we don't update to the startnode if we can't strip
         startctx = repo['.']
-        hg.updaterepo(repo, startctx.node(), True)
+        hg.updaterepo(repo, startctx.node(), overwrite=True)
 
     ui.status(_("graft aborted\n"))
     ui.status(_("working directory is now at %s\n") % startctx.hex()[:12])
@@ -2480,7 +2480,7 @@
     if not graftstate.exists():
         raise error.Abort(_("no interrupted graft found"))
     pctx = repo['.']
-    hg.updaterepo(repo, pctx.node(), True)
+    hg.updaterepo(repo, pctx.node(), overwrite=True)
     graftstate.delete()
     ui.status(_("stopped the interrupted graft\n"))
     ui.status(_("working directory is now at %s\n") % pctx.hex()[:12])