##// END OF EJS Templates
dirstate: change added/modified placeholder hash length to 20 bytes...
Durham Goode -
r30361:1070df14 default
parent child Browse files
Show More
@@ -14,8 +14,10 b' import stat'
14
14
15 from .i18n import _
15 from .i18n import _
16 from .node import (
16 from .node import (
17 addednodeid,
17 bin,
18 bin,
18 hex,
19 hex,
20 modifiednodeid,
19 newnodeid,
21 newnodeid,
20 nullid,
22 nullid,
21 nullrev,
23 nullrev,
@@ -1232,23 +1234,13 b' class committablectx(basectx):'
1232 """
1234 """
1233 parents = self.parents()
1235 parents = self.parents()
1234
1236
1235 man1 = parents[0].manifest()
1237 man = parents[0].manifest().copy()
1236 man = man1.copy()
1237 if len(parents) > 1:
1238 man2 = self.p2().manifest()
1239 def getman(f):
1240 if f in man1:
1241 return man1
1242 return man2
1243 else:
1244 getman = lambda f: man1
1245
1238
1246 copied = self._repo.dirstate.copies()
1247 ff = self._flagfunc
1239 ff = self._flagfunc
1248 for i, l in (("a", self._status.added), ("m", self._status.modified)):
1240 for i, l in ((addednodeid, self._status.added),
1241 (modifiednodeid, self._status.modified)):
1249 for f in l:
1242 for f in l:
1250 orig = copied.get(f, f)
1243 man[f] = i
1251 man[f] = getman(orig).get(orig, nullid) + i
1252 try:
1244 try:
1253 man.setflag(f, ff(f))
1245 man.setflag(f, ff(f))
1254 except OSError:
1246 except OSError:
@@ -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 or n in node.wdirnodes: # in a working context?
281 if 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]
@@ -15,6 +15,7 b' import struct'
15
15
16 from .i18n import _
16 from .i18n import _
17 from .node import (
17 from .node import (
18 addednodeid,
18 bin,
19 bin,
19 hex,
20 hex,
20 nullhex,
21 nullhex,
@@ -873,7 +874,7 b' def manifestmerge(repo, wctx, p2, pa, br'
873 else:
874 else:
874 actions[f] = ('cd', (f, None, f, False, pa.node()),
875 actions[f] = ('cd', (f, None, f, False, pa.node()),
875 "prompt changed/deleted")
876 "prompt changed/deleted")
876 elif n1[20:] == 'a':
877 elif n1 == addednodeid:
877 # This extra 'a' is added by working copy manifest to mark
878 # This extra 'a' is added by working copy manifest to mark
878 # the file as locally added. We should forget it instead of
879 # the file as locally added. We should forget it instead of
879 # deleting it.
880 # deleting it.
@@ -20,8 +20,10 b' nullhex = hex(nullid)'
20 # Phony node value to stand-in for new files in some uses of
20 # Phony node value to stand-in for new files in some uses of
21 # manifests.
21 # manifests.
22 newnodeid = '!' * 20
22 newnodeid = '!' * 20
23 addednodeid = ('0' * 15) + 'added'
24 modifiednodeid = ('0' * 12) + 'modified'
23
25
24 wdirnodes = set((newnodeid,))
26 wdirnodes = set((newnodeid, addednodeid, modifiednodeid))
25
27
26 # pseudo identifiers for working directory
28 # pseudo identifiers for working directory
27 # (they are experimental, so don't add too many dependencies on them)
29 # (they are experimental, so don't add too many dependencies on them)
General Comments 0
You need to be logged in to leave comments. Login now