From patchwork Sat Mar 8 16:07:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4, of, 9] changegroup: add "vfs" argument to "readbundle()" to pass relative filename From: Katsunori FUJIWARA X-Patchwork-Id: 3892 Message-Id: To: mercurial-devel@selenic.com Date: Sun, 09 Mar 2014 01:07:09 +0900 # HG changeset patch # User FUJIWARA Katsunori # 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 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]