Patchwork D3178: largefiles: wrap heads command handler more directly

login
register
mail settings
Submitter phabricator
Date April 9, 2018, 3:13 p.m.
Message ID <0bb4b50f7c5dcceb04a04d4f75875343@localhost.localdomain>
Download mbox | patch
Permalink /patch/30593/
State Not Applicable
Headers show

Comments

phabricator - April 9, 2018, 3:13 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc22fd3c4c23e: largefiles: wrap heads command handler more directly (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3178?vs=7863&id=7895

REVISION DETAIL
  https://phab.mercurial-scm.org/D3178

AFFECTED FILES
  hgext/largefiles/proto.py
  hgext/largefiles/uisetup.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py
--- a/hgext/largefiles/uisetup.py
+++ b/hgext/largefiles/uisetup.py
@@ -174,7 +174,7 @@ 
         wireproto.heads)
 
     # ... and wrap some existing ones
-    wireproto.commands['heads'].func = proto.heads
+    extensions.wrapfunction(wireproto.commands['heads'], 'func', proto.heads)
     # TODO also wrap wireproto.commandsv2 once heads is implemented there.
 
     extensions.wrapfunction(webcommands, 'decodepath', overrides.decodepath)
diff --git a/hgext/largefiles/proto.py b/hgext/largefiles/proto.py
--- a/hgext/largefiles/proto.py
+++ b/hgext/largefiles/proto.py
@@ -168,12 +168,13 @@ 
     caps.append('largefiles=serve')
     return caps
 
-def heads(repo, proto):
+def heads(orig, repo, proto):
     '''Wrap server command - largefile capable clients will know to call
     lheads instead'''
     if lfutil.islfilesrepo(repo):
         return wireprototypes.ooberror(LARGEFILES_REQUIRED_MSG)
-    return wireproto.heads(repo, proto)
+
+    return orig(repo, proto)
 
 def sshrepocallstream(self, cmd, **args):
     if cmd == 'heads' and self.capable('largefiles'):