Patchwork [4,of,9] changegroup: add "vfs" argument to "readbundle()" to pass relative filename

login
register
mail settings
Submitter Katsunori FUJIWARA
Date March 8, 2014, 4:07 p.m.
Message ID <d83efbf778355d4a3e12.1394294829@juju>
Download mbox | patch
Permalink /patch/3892/
State Accepted
Commit 5b58714e97edbbd1e09f7717cf6564e0191d8f57
Headers show

Comments

Katsunori FUJIWARA - March 8, 2014, 4:07 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1394294608 -32400
#      Sun Mar 09 01:03:28 2014 +0900
# Node ID d83efbf778355d4a3e1275b3572654ad7db15bd2
# Parent  8143677ddaf90d3498861ab4030f7cddc88623a3
changegroup: add "vfs" argument to "readbundle()" to pass relative filename

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -212,7 +212,7 @@ 
             return d
         return readexactly(self._fh, n)
 
-def readbundle(fh, fname):
+def readbundle(fh, fname, vfs=None):
     header = readexactly(fh, 6)
 
     if not fname:
@@ -220,6 +220,8 @@ 
         if not header.startswith('HG') and header.startswith('\0'):
             fh = headerlessfixup(fh, header)
             header = "HG10UN"
+    elif vfs:
+        fname = vfs.join(fname)
 
     magic, version, alg = header[0:2], header[2:4], header[4:6]