Mercurial > hg
comparison mercurial/archival.py @ 31235:7feab0e7702d
vfs: use 'vfs' module directly in 'mercurial.archival'
Now that the 'vfs' classes moved in their own module, lets use the new module
directly. We update code iteratively to help with possible bisect needs in the
future.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 02 Mar 2017 13:30:28 +0100 |
parents | 21fa3d3688f3 |
children | 3047167733dc |
comparison
equal
deleted
inserted
replaced
31234:9b7a2ef4f27c | 31235:7feab0e7702d |
---|---|
20 from . import ( | 20 from . import ( |
21 cmdutil, | 21 cmdutil, |
22 encoding, | 22 encoding, |
23 error, | 23 error, |
24 match as matchmod, | 24 match as matchmod, |
25 scmutil, | |
26 util, | 25 util, |
26 vfs as vfsmod, | |
27 ) | 27 ) |
28 stringio = util.stringio | 28 stringio = util.stringio |
29 | 29 |
30 # from unzip source code: | 30 # from unzip source code: |
31 _UNX_IFREG = 0x8000 | 31 _UNX_IFREG = 0x8000 |
247 class fileit(object): | 247 class fileit(object): |
248 '''write archive as files in directory.''' | 248 '''write archive as files in directory.''' |
249 | 249 |
250 def __init__(self, name, mtime): | 250 def __init__(self, name, mtime): |
251 self.basedir = name | 251 self.basedir = name |
252 self.opener = scmutil.vfs(self.basedir) | 252 self.opener = vfsmod.vfs(self.basedir) |
253 | 253 |
254 def addfile(self, name, mode, islink, data): | 254 def addfile(self, name, mode, islink, data): |
255 if islink: | 255 if islink: |
256 self.opener.symlink(data, name) | 256 self.opener.symlink(data, name) |
257 return | 257 return |