comparison mercurial/archival.py @ 39894:d739f423bf06

repo: look up nullrev context by revnum, not symbolic name I think lookup of the 'null' symbol should be done via scmutil.revsymbol() and repo['null'] is only supported for historical reasons. However, repo[nullrev] is fine, so we can switch to that instead of switching to scmutil.revsymbol('null'). Differential Revision: https://phab.mercurial-scm.org/D4780
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 26 Sep 2018 22:17:34 -0700
parents 1a2ff11e8a88
children 844deb408a5b
comparison
equal deleted inserted replaced
39893:f6874567a93b 39894:d739f423bf06
14 import time 14 import time
15 import zipfile 15 import zipfile
16 import zlib 16 import zlib
17 17
18 from .i18n import _ 18 from .i18n import _
19 from .node import (
20 nullrev,
21 )
19 22
20 from . import ( 23 from . import (
21 error, 24 error,
22 formatter, 25 formatter,
23 match as matchmod, 26 match as matchmod,
74 77
75 def _rootctx(repo): 78 def _rootctx(repo):
76 # repo[0] may be hidden 79 # repo[0] may be hidden
77 for rev in repo: 80 for rev in repo:
78 return repo[rev] 81 return repo[rev]
79 return repo['null'] 82 return repo[nullrev]
80 83
81 # {tags} on ctx includes local tags and 'tip', with no current way to limit 84 # {tags} on ctx includes local tags and 'tip', with no current way to limit
82 # that to global tags. Therefore, use {latesttag} as a substitute when 85 # that to global tags. Therefore, use {latesttag} as a substitute when
83 # the distance is 0, since that will be the list of global tags on ctx. 86 # the distance is 0, since that will be the list of global tags on ctx.
84 _defaultmetatemplate = br''' 87 _defaultmetatemplate = br'''