##// 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 from .node import (
16 from .node import (
17 bin,
17 bin,
18 hex,
18 hex,
19 newnodeid,
19 nullid,
20 nullid,
20 nullrev,
21 nullrev,
21 short,
22 short,
@@ -39,11 +40,6 b' from . import ('
39
40
40 propertycache = util.propertycache
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 nonascii = re.compile(r'[^\x21-\x7f]').search
43 nonascii = re.compile(r'[^\x21-\x7f]').search
48
44
49 class basectx(object):
45 class basectx(object):
@@ -142,7 +138,7 b' class basectx(object):'
142 removed.append(fn)
138 removed.append(fn)
143 elif flag1 != flag2:
139 elif flag1 != flag2:
144 modified.append(fn)
140 modified.append(fn)
145 elif node2 != _newnode:
141 elif node2 != newnodeid:
146 # When comparing files between two commits, we save time by
142 # When comparing files between two commits, we save time by
147 # not comparing the file contents when the nodeids differ.
143 # not comparing the file contents when the nodeids differ.
148 # Note that this means we incorrectly report a reverted change
144 # Note that this means we incorrectly report a reverted change
@@ -1587,7 +1583,7 b' class workingctx(committablectx):'
1587 """
1583 """
1588 mf = self._repo['.']._manifestmatches(match, s)
1584 mf = self._repo['.']._manifestmatches(match, s)
1589 for f in s.modified + s.added:
1585 for f in s.modified + s.added:
1590 mf[f] = _newnode
1586 mf[f] = newnodeid
1591 mf.setflag(f, self.flags(f))
1587 mf.setflag(f, self.flags(f))
1592 for f in s.removed:
1588 for f in s.removed:
1593 if f in mf:
1589 if f in mf:
@@ -278,7 +278,7 b' def _makegetfctx(ctx):'
278 ac = repo.changelog.ancestors(revs, inclusive=True)
278 ac = repo.changelog.ancestors(revs, inclusive=True)
279 ctx._ancestrycontext = ac
279 ctx._ancestrycontext = ac
280 def makectx(f, n):
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 if ctx.rev() is None:
282 if ctx.rev() is None:
283 return ctx.filectx(f)
283 return ctx.filectx(f)
284 return repo[None][f]
284 return repo[None][f]
@@ -17,6 +17,12 b' nullrev = -1'
17 nullid = b"\0" * 20
17 nullid = b"\0" * 20
18 nullhex = hex(nullid)
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 # pseudo identifiers for working directory
26 # pseudo identifiers for working directory
21 # (they are experimental, so don't add too many dependencies on them)
27 # (they are experimental, so don't add too many dependencies on them)
22 wdirrev = 0x7fffffff
28 wdirrev = 0x7fffffff
General Comments 0
You need to be logged in to leave comments. Login now