Patchwork repair: make strip() return backup file path

login
register
mail settings
Submitter via Mercurial-devel
Date Nov. 2, 2016, 9:45 p.m.
Message ID <2e435c3beb8c31822347.1478123157@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/17290/
State Accepted
Headers show

Comments

via Mercurial-devel - Nov. 2, 2016, 9:45 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1477953630 25200
#      Mon Oct 31 15:40:30 2016 -0700
# Node ID 2e435c3beb8c31822347661a898a7e94a5cee08e
# Parent  6a8aff737a17ada068b8ce4501184eacc66e827f
repair: make strip() return backup file path

narrowhg wants to strip some commits and then re-apply them after
applying another bundle. Having repair.strip() return the bundle path
will be helpful for it.
Pierre-Yves David - Nov. 3, 2016, 4:10 p.m.
On 11/02/2016 10:45 PM, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1477953630 25200
> #      Mon Oct 31 15:40:30 2016 -0700
> # Node ID 2e435c3beb8c31822347661a898a7e94a5cee08e
> # Parent  6a8aff737a17ada068b8ce4501184eacc66e827f
> repair: make strip() return backup file path

This make sense, pushed, thanks.

Patch

diff -r 6a8aff737a17 -r 2e435c3beb8c mercurial/repair.py
--- a/mercurial/repair.py	Sat Oct 15 17:24:01 2016 -0700
+++ b/mercurial/repair.py	Mon Oct 31 15:40:30 2016 -0700
@@ -244,6 +244,9 @@ 
             vfs.unlink(tmpbundlefile)
 
     repo.destroyed()
+    # return the backup file path (or None if 'backup' was False) so
+    # extensions can use it
+    return backupfile
 
 def rebuildfncache(ui, repo):
     """Rebuilds the fncache file from repo history.