Show More
@@ -992,6 +992,16 b' class basefilectx:' | |||
|
992 | 992 | if self._repo._encodefilterpats: |
|
993 | 993 | # can't rely on size() because wdir content may be decoded |
|
994 | 994 | return self._filelog.cmp(self._filenode, fctx.data()) |
|
995 | # filelog.size() has two special cases: | |
|
996 | # - censored metadata | |
|
997 | # - copy/rename tracking | |
|
998 | # The first is detected by peaking into the delta, | |
|
999 | # the second is detected by abusing parent order | |
|
1000 | # in the revlog index as flag bit. This leaves files using | |
|
1001 | # the dummy encoding and non-standard meta attributes. | |
|
1002 | # The following check is a special case for the empty | |
|
1003 | # metadata block used if the raw file content starts with '\1\n'. | |
|
1004 | # Cases of arbitrary metadata flags are currently mishandled. | |
|
995 | 1005 | if self.size() - 4 == fctx.size(): |
|
996 | 1006 | # size() can match: |
|
997 | 1007 | # if file data starts with '\1\n', empty metadata block is |
@@ -32,6 +32,7 b' class filelog:' | |||
|
32 | 32 | target=(revlog_constants.KIND_FILELOG, path), |
|
33 | 33 | radix=b'/'.join((b'data', path)), |
|
34 | 34 | censorable=True, |
|
35 | canonical_parent_order=False, # see comment in revlog.py | |
|
35 | 36 | ) |
|
36 | 37 | # Full name of the user visible file, relative to the repository root. |
|
37 | 38 | # Used by LFS. |
@@ -207,6 +208,7 b' class filelog:' | |||
|
207 | 208 | return 0 |
|
208 | 209 | |
|
209 | 210 | # XXX if self.read(node).startswith("\1\n"), this returns (size+4) |
|
211 | # XXX See also basefilectx.cmp. | |
|
210 | 212 | return self._revlog.size(rev) |
|
211 | 213 | |
|
212 | 214 | def cmp(self, node, text): |
@@ -298,6 +298,7 b' class revlog:' | |||
|
298 | 298 | persistentnodemap=False, |
|
299 | 299 | concurrencychecker=None, |
|
300 | 300 | trypending=False, |
|
301 | canonical_parent_order=True, | |
|
301 | 302 | ): |
|
302 | 303 | """ |
|
303 | 304 | create a revlog object |
@@ -373,6 +374,13 b' class revlog:' | |||
|
373 | 374 | |
|
374 | 375 | self._concurrencychecker = concurrencychecker |
|
375 | 376 | |
|
377 | # parent order is supposed to be semantically irrelevant, so we | |
|
378 | # normally resort parents to ensure that the first parent is non-null, | |
|
379 | # if there is a non-null parent at all. | |
|
380 | # filelog abuses the parent order as flag to mark some instances of | |
|
381 | # meta-encoded files, so allow it to disable this behavior. | |
|
382 | self.canonical_parent_order = canonical_parent_order | |
|
383 | ||
|
376 | 384 | def _init_opts(self): |
|
377 | 385 | """process options (from above/config) to setup associated default revlog mode |
|
378 | 386 | |
@@ -898,6 +906,9 b' class revlog:' | |||
|
898 | 906 | raise error.WdirUnsupported |
|
899 | 907 | raise |
|
900 | 908 | |
|
909 | if self.canonical_parent_order and entry[5] == nullrev: | |
|
910 | return entry[6], entry[5] | |
|
911 | else: | |
|
901 | 912 | return entry[5], entry[6] |
|
902 | 913 | |
|
903 | 914 | # fast parentrevs(rev) where rev isn't filtered |
@@ -919,7 +930,11 b' class revlog:' | |||
|
919 | 930 | def parents(self, node): |
|
920 | 931 | i = self.index |
|
921 | 932 | d = i[self.rev(node)] |
|
922 | return i[d[5]][7], i[d[6]][7] # map revisions to nodes inline | |
|
933 | # inline node() to avoid function call overhead | |
|
934 | if self.canonical_parent_order and d[5] == self.nullid: | |
|
935 | return i[d[6]][7], i[d[5]][7] | |
|
936 | else: | |
|
937 | return i[d[5]][7], i[d[6]][7] | |
|
923 | 938 | |
|
924 | 939 | def chainlen(self, rev): |
|
925 | 940 | return self._chaininfo(rev)[0] |
@@ -179,7 +179,7 b' has been emitted, just in a different or' | |||
|
179 | 179 | |
|
180 | 180 | |
|
181 | 181 | $ hg log -T '{if(ellipsis,"...")}{node|short} {p1node|short} {p2node|short} {desc}\n' | sort |
|
182 |
...2a20009de83e |
|
|
182 | ...2a20009de83e 3ac1f5779de3 000000000000 outside 10 | |
|
183 | 183 | ...3ac1f5779de3 bb96a08b062a 465567bdfb2d merge a/b/c/d 9 |
|
184 | 184 | ...8d874d57adea 7ef88b4dd4fa 000000000000 outside 12 |
|
185 | 185 | ...b844052e7b3b 000000000000 000000000000 outside 2c |
General Comments 0
You need to be logged in to leave comments.
Login now