repair: rename _backup to backupbundle
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 04 Mar 2018 10:34:09 -0500
changeset 37016 17692fefc8f2
parent 37015 a318bb154d42
child 37017 98c14e857e71
repair: rename _backup to backupbundle A future commit will introduce a caller from outside the module. The function should have already been public because histedit was calling it. Differential Revision: https://phab.mercurial-scm.org/D2666
hgext/histedit.py
mercurial/repair.py
--- a/hgext/histedit.py	Mon Mar 19 22:10:40 2018 +0900
+++ b/hgext/histedit.py	Sun Mar 04 10:34:09 2018 -0500
@@ -1317,8 +1317,8 @@
     # Create a backup so we can always abort completely.
     backupfile = None
     if not obsolete.isenabled(repo, obsolete.createmarkersopt):
-        backupfile = repair._bundle(repo, [parentctxnode], [topmost], root,
-                                    'histedit')
+        backupfile = repair.backupbundle(repo, [parentctxnode],
+                                         [topmost], root, 'histedit')
     state.backupfile = backupfile
 
 def _getsummary(ctx):
--- a/mercurial/repair.py	Mon Mar 19 22:10:40 2018 +0900
+++ b/mercurial/repair.py	Sun Mar 04 10:34:09 2018 -0500
@@ -27,7 +27,8 @@
     util,
 )
 
-def _bundle(repo, bases, heads, node, suffix, compress=True, obsolescence=True):
+def backupbundle(repo, bases, heads, node, suffix, compress=True,
+                 obsolescence=True):
     """create a bundle with the specified revisions as a backup"""
 
     backupdir = "strip-backup"
@@ -166,7 +167,7 @@
     vfs = repo.vfs
     node = nodelist[-1]
     if backup:
-        backupfile = _bundle(repo, stripbases, cl.heads(), node, topic)
+        backupfile = backupbundle(repo, stripbases, cl.heads(), node, topic)
         repo.ui.status(_("saved backup bundle to %s\n") %
                        vfs.join(backupfile))
         repo.ui.log("backupbundle", "saved backup bundle to %s\n",
@@ -179,8 +180,8 @@
         # we are trying to strip.  This is harmless since the stripped markers
         # are already backed up and we did not touched the markers for the
         # saved changesets.
-        tmpbundlefile = _bundle(repo, savebases, saveheads, node, 'temp',
-                                compress=False, obsolescence=False)
+        tmpbundlefile = backupbundle(repo, savebases, saveheads, node, 'temp',
+                                     compress=False, obsolescence=False)
 
     try:
         with repo.transaction("strip") as tr: