diff mercurial/repair.py @ 24170:fbc4d550a6ab

repair: setup hookargs when processing bundle2s addchangegroup() modifies its behavior based on the transaction source. This is incorrect for bundle2 repair files, causing rebases to abort when this option is enabled. This diff specifies the source type in the way recommended by comments in bundle2.py and adds a test to ensure that rebases with the experimental option work successfully.
author Eric Sumner <ericsumner@fb.com>
date Fri, 20 Feb 2015 13:55:01 -0800
parents 33d1b81c6ef0
children f962692853c0
line wrap: on
line diff
--- a/mercurial/repair.py	Mon Mar 02 10:55:19 2015 -0600
+++ b/mercurial/repair.py	Fri Feb 20 13:55:01 2015 -0800
@@ -181,6 +181,8 @@
                 repo.ui.pushbuffer()
             if isinstance(gen, bundle2.unbundle20):
                 tr = repo.transaction('strip')
+                tr.hookargs = {'source': 'strip',
+                               'url': 'bundle:' + vfs.join(chgrpfile)}
                 try:
                     bundle2.processbundle(repo, gen, lambda: tr)
                     tr.close()