mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
Update wrapping to work with Mercurial 3.6
This commit is contained in:
parent
a6e7769d60
commit
2d8cf7b54e
13
hgsql.py
13
hgsql.py
@ -75,7 +75,11 @@ def uisetup(ui):
|
||||
wireproto.commands['pushkey'] = (wireproto.pushkey, 'namespace key old new')
|
||||
|
||||
wrapfunction(bookmarks, 'updatefromremote', updatefromremote)
|
||||
wrapfunction(changegroup, 'addchangegroup', addchangegroup)
|
||||
if util.safehasattr(changegroup, 'addchangegroup'):
|
||||
wrapfunction(changegroup, 'addchangegroup', addchangegroup)
|
||||
else:
|
||||
# Mercurial 3.6+
|
||||
wrapfunction(changegroup.cg1unpacker, 'apply', changegroupapply)
|
||||
|
||||
# Record revlog writes
|
||||
def writeentry(orig, self, transaction, ifh, dfh, entry, data, link, offset):
|
||||
@ -213,6 +217,13 @@ def addchangegroup(orig, *args, **kwargs):
|
||||
else:
|
||||
return orig(*args, **kwargs)
|
||||
|
||||
def changegroupapply(orig, *args, **kwargs):
|
||||
repo = args[1]
|
||||
if repo.ui.configbool("hgsql", "enabled"):
|
||||
return executewithsql(repo, orig, True, *args, **kwargs)
|
||||
else:
|
||||
return orig(*args, **kwargs)
|
||||
|
||||
def _localphasemove(orig, pushop, *args, **kwargs):
|
||||
repo = pushop.repo
|
||||
if repo.ui.configbool("hgsql", "enabled"):
|
||||
|
Loading…
Reference in New Issue
Block a user