Show More
@@ -1805,6 +1805,11 b' class overlayworkingctx(committablectx):' | |||||
1805 | else: |
|
1805 | else: | |
1806 | return self._wrappedctx[path].flags() |
|
1806 | return self._wrappedctx[path].flags() | |
1807 |
|
1807 | |||
|
1808 | def __contains__(self, key): | |||
|
1809 | if key in self._cache: | |||
|
1810 | return self._cache[key]['exists'] | |||
|
1811 | return key in self.p1() | |||
|
1812 | ||||
1808 | def _existsinparent(self, path): |
|
1813 | def _existsinparent(self, path): | |
1809 | try: |
|
1814 | try: | |
1810 | # ``commitctx` raises a ``ManifestLookupError`` if a path does not |
|
1815 | # ``commitctx` raises a ``ManifestLookupError`` if a path does not | |
@@ -1839,7 +1844,7 b' class overlayworkingctx(committablectx):' | |||||
1839 | components = path.split('/') |
|
1844 | components = path.split('/') | |
1840 | for i in pycompat.xrange(len(components)): |
|
1845 | for i in pycompat.xrange(len(components)): | |
1841 | component = "/".join(components[0:i]) |
|
1846 | component = "/".join(components[0:i]) | |
1842 |
if component in self |
|
1847 | if component in self: | |
1843 | fail(path, component) |
|
1848 | fail(path, component) | |
1844 |
|
1849 | |||
1845 | # Test the other direction -- that this path from p2 isn't a directory |
|
1850 | # Test the other direction -- that this path from p2 isn't a directory | |
@@ -1851,7 +1856,7 b' class overlayworkingctx(committablectx):' | |||||
1851 | if len(mfiles) == 1 and mfiles[0] == path: |
|
1856 | if len(mfiles) == 1 and mfiles[0] == path: | |
1852 | return |
|
1857 | return | |
1853 | # omit the files which are deleted in current IMM wctx |
|
1858 | # omit the files which are deleted in current IMM wctx | |
1854 |
mfiles = [m for m in mfiles if self |
|
1859 | mfiles = [m for m in mfiles if m in self] | |
1855 | if not mfiles: |
|
1860 | if not mfiles: | |
1856 | return |
|
1861 | return | |
1857 | raise error.Abort("error: file '%s' cannot be written because " |
|
1862 | raise error.Abort("error: file '%s' cannot be written because " |
@@ -243,12 +243,16 b' Test reporting of path conflicts' | |||||
243 | $ echo c > c/c |
|
243 | $ echo c > c/c | |
244 | $ hg add c/c |
|
244 | $ hg add c/c | |
245 | $ hg ci -m 'c/c' |
|
245 | $ hg ci -m 'c/c' | |
246 | BROKEN: This should be a conflict, should not crash |
|
246 | $ hg rebase -r . -d 3 -n | |
247 | $ hg rebase -r . -d 3 -n 2>&1 | grep KeyError |
|
247 | starting dry-run rebase; repository will not be changed | |
248 | KeyError: 'c' |
|
248 | rebasing 8:755f0104af9b "c/c" (tip) | |
249 | BROKEN: This should be a conflict, should not crash |
|
249 | abort: error: 'c/c' conflicts with file 'c' in 3. | |
250 | $ hg rebase -r 3 -d . -n 2>&1 | grep KeyError |
|
250 | [255] | |
251 | KeyError: 'c/c' |
|
251 | $ hg rebase -r 3 -d . -n | |
|
252 | starting dry-run rebase; repository will not be changed | |||
|
253 | rebasing 3:844a7de3e617 "c" | |||
|
254 | abort: error: file 'c' cannot be written because 'c/' is a folder in 755f0104af9b (containing 1 entries: c/c) | |||
|
255 | [255] | |||
252 |
|
256 | |||
253 | $ cd .. |
|
257 | $ cd .. | |
254 |
|
258 |
General Comments 0
You need to be logged in to leave comments.
Login now