Show More
@@ -17,7 +17,7 b' from mercurial import (' | |||||
17 | for fp in (sys.stdin, sys.stdout, sys.stderr): |
|
17 | for fp in (sys.stdin, sys.stdout, sys.stderr): | |
18 | util.setbinary(fp) |
|
18 | util.setbinary(fp) | |
19 |
|
19 | |||
20 |
opener = scmutil. |
|
20 | opener = scmutil.vfs('.', False) | |
21 | tr = transaction.transaction(sys.stderr.write, opener, {'store': opener}, |
|
21 | tr = transaction.transaction(sys.stderr.write, opener, {'store': opener}, | |
22 | "undump.journal") |
|
22 | "undump.journal") | |
23 | while True: |
|
23 | while True: |
@@ -1146,8 +1146,8 b' class svn_sink(converter_sink, commandli' | |||||
1146 | self.run0('checkout', path, wcpath) |
|
1146 | self.run0('checkout', path, wcpath) | |
1147 |
|
1147 | |||
1148 | self.wc = wcpath |
|
1148 | self.wc = wcpath | |
1149 |
self.opener = scmutil. |
|
1149 | self.opener = scmutil.vfs(self.wc) | |
1150 |
self.wopener = scmutil. |
|
1150 | self.wopener = scmutil.vfs(self.wc) | |
1151 | self.childmap = mapfile(ui, self.join('hg-childmap')) |
|
1151 | self.childmap = mapfile(ui, self.join('hg-childmap')) | |
1152 | if util.checkexec(self.wc): |
|
1152 | if util.checkexec(self.wc): | |
1153 | self.is_exec = util.isexec |
|
1153 | self.is_exec = util.isexec |
@@ -144,7 +144,7 b' def openlfdirstate(ui, repo, create=True' | |||||
144 | ''' |
|
144 | ''' | |
145 | vfs = repo.vfs |
|
145 | vfs = repo.vfs | |
146 | lfstoredir = longname |
|
146 | lfstoredir = longname | |
147 |
opener = scmutil. |
|
147 | opener = scmutil.vfs(vfs.join(lfstoredir)) | |
148 | lfdirstate = largefilesdirstate(opener, ui, repo.root, |
|
148 | lfdirstate = largefilesdirstate(opener, ui, repo.root, | |
149 | repo.dirstate._validate) |
|
149 | repo.dirstate._validate) | |
150 |
|
150 |
@@ -434,7 +434,7 b' class queue(object):' | |||||
434 | except IOError: |
|
434 | except IOError: | |
435 | curpath = os.path.join(path, 'patches') |
|
435 | curpath = os.path.join(path, 'patches') | |
436 | self.path = patchdir or curpath |
|
436 | self.path = patchdir or curpath | |
437 |
self.opener = scmutil. |
|
437 | self.opener = scmutil.vfs(self.path) | |
438 | self.ui = ui |
|
438 | self.ui = ui | |
439 | self.baseui = baseui |
|
439 | self.baseui = baseui | |
440 | self.applieddirty = False |
|
440 | self.applieddirty = False |
@@ -60,7 +60,7 b' class transplants(object):' | |||||
60 | self.opener = opener |
|
60 | self.opener = opener | |
61 |
|
61 | |||
62 | if not opener: |
|
62 | if not opener: | |
63 |
self.opener = scmutil. |
|
63 | self.opener = scmutil.vfs(self.path) | |
64 | self.transplants = {} |
|
64 | self.transplants = {} | |
65 | self.dirty = False |
|
65 | self.dirty = False | |
66 | self.read() |
|
66 | self.read() | |
@@ -103,7 +103,7 b' class transplanter(object):' | |||||
103 | def __init__(self, ui, repo, opts): |
|
103 | def __init__(self, ui, repo, opts): | |
104 | self.ui = ui |
|
104 | self.ui = ui | |
105 | self.path = repo.join('transplant') |
|
105 | self.path = repo.join('transplant') | |
106 |
self.opener = scmutil. |
|
106 | self.opener = scmutil.vfs(self.path) | |
107 | self.transplants = transplants(self.path, 'transplants', |
|
107 | self.transplants = transplants(self.path, 'transplants', | |
108 | opener=self.opener) |
|
108 | opener=self.opener) | |
109 | def getcommiteditor(): |
|
109 | def getcommiteditor(): |
@@ -249,7 +249,7 b' class fileit(object):' | |||||
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. |
|
252 | self.opener = scmutil.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: |
@@ -583,7 +583,7 b' def openrevlog(repo, cmd, file_, opts):' | |||||
583 | raise error.CommandError(cmd, _('invalid arguments')) |
|
583 | raise error.CommandError(cmd, _('invalid arguments')) | |
584 | if not os.path.isfile(file_): |
|
584 | if not os.path.isfile(file_): | |
585 | raise error.Abort(_("revlog '%s' not found") % file_) |
|
585 | raise error.Abort(_("revlog '%s' not found") % file_) | |
586 |
r = revlog.revlog(scmutil. |
|
586 | r = revlog.revlog(scmutil.vfs(pycompat.getcwd(), audit=False), | |
587 | file_[:-2] + ".i") |
|
587 | file_[:-2] + ".i") | |
588 | return r |
|
588 | return r | |
589 |
|
589 |
@@ -76,7 +76,7 b' def debugancestor(ui, repo, *args):' | |||||
76 | """find the ancestor revision of two revisions in a given index""" |
|
76 | """find the ancestor revision of two revisions in a given index""" | |
77 | if len(args) == 3: |
|
77 | if len(args) == 3: | |
78 | index, rev1, rev2 = args |
|
78 | index, rev1, rev2 = args | |
79 |
r = revlog.revlog(scmutil. |
|
79 | r = revlog.revlog(scmutil.vfs(pycompat.getcwd(), audit=False), index) | |
80 | lookup = r.lookup |
|
80 | lookup = r.lookup | |
81 | elif len(args) == 2: |
|
81 | elif len(args) == 2: | |
82 | if not repo: |
|
82 | if not repo: | |
@@ -452,7 +452,7 b' def debugdag(ui, repo, file_=None, *revs' | |||||
452 | spaces = opts.get('spaces') |
|
452 | spaces = opts.get('spaces') | |
453 | dots = opts.get('dots') |
|
453 | dots = opts.get('dots') | |
454 | if file_: |
|
454 | if file_: | |
455 |
rlog = revlog.revlog(scmutil. |
|
455 | rlog = revlog.revlog(scmutil.vfs(pycompat.getcwd(), audit=False), | |
456 | file_) |
|
456 | file_) | |
457 | revs = set((int(r) for r in revs)) |
|
457 | revs = set((int(r) for r in revs)) | |
458 | def events(): |
|
458 | def events(): |
@@ -449,7 +449,7 b' class abstractbackend(object):' | |||||
449 | class fsbackend(abstractbackend): |
|
449 | class fsbackend(abstractbackend): | |
450 | def __init__(self, ui, basedir): |
|
450 | def __init__(self, ui, basedir): | |
451 | super(fsbackend, self).__init__(ui) |
|
451 | super(fsbackend, self).__init__(ui) | |
452 |
self.opener = scmutil. |
|
452 | self.opener = scmutil.vfs(basedir) | |
453 |
|
453 | |||
454 | def _join(self, f): |
|
454 | def _join(self, f): | |
455 | return os.path.join(self.opener.base, f) |
|
455 | return os.path.join(self.opener.base, f) | |
@@ -560,7 +560,7 b' class filestore(object):' | |||||
560 | else: |
|
560 | else: | |
561 | if self.opener is None: |
|
561 | if self.opener is None: | |
562 | root = tempfile.mkdtemp(prefix='hg-patch-') |
|
562 | root = tempfile.mkdtemp(prefix='hg-patch-') | |
563 |
self.opener = scmutil. |
|
563 | self.opener = scmutil.vfs(root) | |
564 | # Avoid filename issues with these simple names |
|
564 | # Avoid filename issues with these simple names | |
565 | fn = str(self.created) |
|
565 | fn = str(self.created) | |
566 | self.opener.write(fn, data) |
|
566 | self.opener.write(fn, data) |
@@ -437,7 +437,7 b' def simplemerge(ui, local, base, other, ' | |||||
437 |
|
437 | |||
438 | local = os.path.realpath(local) |
|
438 | local = os.path.realpath(local) | |
439 | if not opts.get('print'): |
|
439 | if not opts.get('print'): | |
440 |
opener = scmutil. |
|
440 | opener = scmutil.vfs(os.path.dirname(local)) | |
441 | out = opener(os.path.basename(local), "w", atomictemp=True) |
|
441 | out = opener(os.path.basename(local), "w", atomictemp=True) | |
442 | else: |
|
442 | else: | |
443 | out = ui.fout |
|
443 | out = ui.fout |
@@ -73,7 +73,7 b' def basic(repo):' | |||||
73 | # atomic replace file, size doesn't change |
|
73 | # atomic replace file, size doesn't change | |
74 | # hopefully st_mtime doesn't change as well so this doesn't use the cache |
|
74 | # hopefully st_mtime doesn't change as well so this doesn't use the cache | |
75 | # because of inode change |
|
75 | # because of inode change | |
76 |
f = scmutil. |
|
76 | f = scmutil.vfs('.')('x', 'w', atomictemp=True) | |
77 | f.write('b') |
|
77 | f.write('b') | |
78 | f.close() |
|
78 | f.close() | |
79 |
|
79 | |||
@@ -97,7 +97,7 b' def basic(repo):' | |||||
97 | # should recreate the object |
|
97 | # should recreate the object | |
98 | repo.cached |
|
98 | repo.cached | |
99 |
|
99 | |||
100 |
f = scmutil. |
|
100 | f = scmutil.vfs('.')('y', 'w', atomictemp=True) | |
101 | f.write('B') |
|
101 | f.write('B') | |
102 | f.close() |
|
102 | f.close() | |
103 |
|
103 | |||
@@ -105,10 +105,10 b' def basic(repo):' | |||||
105 | print("* file y changed inode") |
|
105 | print("* file y changed inode") | |
106 | repo.cached |
|
106 | repo.cached | |
107 |
|
107 | |||
108 |
f = scmutil. |
|
108 | f = scmutil.vfs('.')('x', 'w', atomictemp=True) | |
109 | f.write('c') |
|
109 | f.write('c') | |
110 | f.close() |
|
110 | f.close() | |
111 |
f = scmutil. |
|
111 | f = scmutil.vfs('.')('y', 'w', atomictemp=True) | |
112 | f.write('C') |
|
112 | f.write('C') | |
113 | f.close() |
|
113 | f.close() | |
114 |
|
114 |
@@ -42,7 +42,7 b' We approximate that by reducing the read' | |||||
42 | > return getattr(self.real, key) |
|
42 | > return getattr(self.real, key) | |
43 | > |
|
43 | > | |
44 | > def opener(*args): |
|
44 | > def opener(*args): | |
45 |
> o = scmutil. |
|
45 | > o = scmutil.vfs(*args) | |
46 | > def wrapper(*a): |
|
46 | > def wrapper(*a): | |
47 | > f = o(*a) |
|
47 | > f = o(*a) | |
48 | > return singlebyteread(f) |
|
48 | > return singlebyteread(f) |
General Comments 0
You need to be logged in to leave comments.
Login now