Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 31216:21fa3d3688f3
vfs: replace 'scmutil.opener' usage with 'scmutil.vfs'
The 'vfs' class is the first class citizen for years. We remove all usages of
the older API. This will let us remove the old API eventually.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 02 Mar 2017 03:52:36 +0100 |
parents | 8fc55bbd2235 |
children | 9cdba6072b97 |
comparison
equal
deleted
inserted
replaced
31215:15c998528c36 | 31216:21fa3d3688f3 |
---|---|
74 @command('debugancestor', [], _('[INDEX] REV1 REV2'), optionalrepo=True) | 74 @command('debugancestor', [], _('[INDEX] REV1 REV2'), optionalrepo=True) |
75 def debugancestor(ui, repo, *args): | 75 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.opener(pycompat.getcwd(), audit=False), index) | 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: |
83 raise error.Abort(_('there is no Mercurial repository here ' | 83 raise error.Abort(_('there is no Mercurial repository here ' |
84 '(.hg not found)')) | 84 '(.hg not found)')) |
450 Otherwise, the changelog DAG of the current repo is emitted. | 450 Otherwise, the changelog DAG of the current repo is emitted. |
451 """ | 451 """ |
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.opener(pycompat.getcwd(), audit=False), | 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(): |
459 for r in rlog: | 459 for r in rlog: |
460 yield 'n', (r, list(p for p in rlog.parentrevs(r) | 460 yield 'n', (r, list(p for p in rlog.parentrevs(r) |