##// END OF EJS Templates
dirstate: change placeholder hash length to 20 bytes...
Durham Goode -
r30360:0298a07f default
parent child Browse files
Show More
@@ -16,6 +16,7 b' from .i18n import _'
16 16 from .node import (
17 17 bin,
18 18 hex,
19 newnodeid,
19 20 nullid,
20 21 nullrev,
21 22 short,
@@ -39,11 +40,6 b' from . import ('
39 40
40 41 propertycache = util.propertycache
41 42
42 # Phony node value to stand-in for new files in some uses of
43 # manifests. Manifests support 21-byte hashes for nodes which are
44 # dirty in the working copy.
45 _newnode = '!' * 21
46
47 43 nonascii = re.compile(r'[^\x21-\x7f]').search
48 44
49 45 class basectx(object):
@@ -142,7 +138,7 b' class basectx(object):'
142 138 removed.append(fn)
143 139 elif flag1 != flag2:
144 140 modified.append(fn)
145 elif node2 != _newnode:
141 elif node2 != newnodeid:
146 142 # When comparing files between two commits, we save time by
147 143 # not comparing the file contents when the nodeids differ.
148 144 # Note that this means we incorrectly report a reverted change
@@ -1587,7 +1583,7 b' class workingctx(committablectx):'
1587 1583 """
1588 1584 mf = self._repo['.']._manifestmatches(match, s)
1589 1585 for f in s.modified + s.added:
1590 mf[f] = _newnode
1586 mf[f] = newnodeid
1591 1587 mf.setflag(f, self.flags(f))
1592 1588 for f in s.removed:
1593 1589 if f in mf:
@@ -278,7 +278,7 b' def _makegetfctx(ctx):'
278 278 ac = repo.changelog.ancestors(revs, inclusive=True)
279 279 ctx._ancestrycontext = ac
280 280 def makectx(f, n):
281 if len(n) != 20: # in a working context?
281 if len(n) != 20 or n in node.wdirnodes: # in a working context?
282 282 if ctx.rev() is None:
283 283 return ctx.filectx(f)
284 284 return repo[None][f]
@@ -17,6 +17,12 b' nullrev = -1'
17 17 nullid = b"\0" * 20
18 18 nullhex = hex(nullid)
19 19
20 # Phony node value to stand-in for new files in some uses of
21 # manifests.
22 newnodeid = '!' * 20
23
24 wdirnodes = set((newnodeid,))
25
20 26 # pseudo identifiers for working directory
21 27 # (they are experimental, so don't add too many dependencies on them)
22 28 wdirrev = 0x7fffffff
General Comments 0
You need to be logged in to leave comments. Login now