equal
deleted
inserted
replaced
14 import repoview |
14 import repoview |
15 import fileset |
15 import fileset |
16 import revlog |
16 import revlog |
17 |
17 |
18 propertycache = util.propertycache |
18 propertycache = util.propertycache |
|
19 |
|
20 # Phony node value to stand-in for new files in some uses of |
|
21 # manifests. Manifests support 21-byte hashes for nodes which are |
|
22 # dirty in the working copy. |
|
23 _newnode = '!' * 21 |
19 |
24 |
20 class basectx(object): |
25 class basectx(object): |
21 """A basectx object represents the common logic for its children: |
26 """A basectx object represents the common logic for its children: |
22 changectx: read-only context that is already present in the repo, |
27 changectx: read-only context that is already present in the repo, |
23 workingctx: a context that represents the working directory and can |
28 workingctx: a context that represents the working directory and can |
102 for fn, mf2node in mf2.iteritems(): |
107 for fn, mf2node in mf2.iteritems(): |
103 if fn in mf1: |
108 if fn in mf1: |
104 if (fn not in deletedset and |
109 if (fn not in deletedset and |
105 ((fn in withflags and mf1.flags(fn) != mf2.flags(fn)) or |
110 ((fn in withflags and mf1.flags(fn) != mf2.flags(fn)) or |
106 (mf1[fn] != mf2node and |
111 (mf1[fn] != mf2node and |
107 (mf2node or self[fn].cmp(other[fn]))))): |
112 (mf2node != _newnode or self[fn].cmp(other[fn]))))): |
108 modified.append(fn) |
113 modified.append(fn) |
109 elif listclean: |
114 elif listclean: |
110 clean.append(fn) |
115 clean.append(fn) |
111 del mf1[fn] |
116 del mf1[fn] |
112 elif fn not in deletedset: |
117 elif fn not in deletedset: |
1380 which means this function is comparing with a non-parent; therefore we |
1385 which means this function is comparing with a non-parent; therefore we |
1381 need to build a manifest and return what matches. |
1386 need to build a manifest and return what matches. |
1382 """ |
1387 """ |
1383 mf = self._repo['.']._manifestmatches(match, s) |
1388 mf = self._repo['.']._manifestmatches(match, s) |
1384 for f in s.modified + s.added: |
1389 for f in s.modified + s.added: |
1385 mf[f] = None |
1390 mf[f] = _newnode |
1386 mf.setflag(f, self.flags(f)) |
1391 mf.setflag(f, self.flags(f)) |
1387 for f in s.removed: |
1392 for f in s.removed: |
1388 if f in mf: |
1393 if f in mf: |
1389 del mf[f] |
1394 del mf[f] |
1390 return mf |
1395 return mf |