##// END OF EJS Templates
context: don't count deleted files as candidates for path conflicts in IMM...
Pulkit Goyal -
r39612:fa4d16da default
parent child Browse files
Show More
@@ -1910,14 +1910,19 b' class overlayworkingctx(committablectx):'
1910 # in p1 (test that p1 doesn't any paths matching `path/*`).
1910 # in p1 (test that p1 doesn't any paths matching `path/*`).
1911 match = matchmod.match('/', '', [path + '/'], default=b'relpath')
1911 match = matchmod.match('/', '', [path + '/'], default=b'relpath')
1912 matches = self.p1().manifest().matches(match)
1912 matches = self.p1().manifest().matches(match)
1913 if len(matches) > 0:
1913 mfiles = matches.keys()
1914 if len(matches) == 1 and matches.keys()[0] == path:
1914 if len(mfiles) > 0:
1915 if len(mfiles) == 1 and mfiles[0] == path:
1916 return
1917 # omit the files which are deleted in current IMM wctx
1918 mfiles = [m for m in mfiles if self._cache[m]['exists']]
1919 if not mfiles:
1915 return
1920 return
1916 raise error.Abort("error: file '%s' cannot be written because "
1921 raise error.Abort("error: file '%s' cannot be written because "
1917 " '%s/' is a folder in %s (containing %d "
1922 " '%s/' is a folder in %s (containing %d "
1918 "entries: %s)"
1923 "entries: %s)"
1919 % (path, path, self.p1(), len(matches),
1924 % (path, path, self.p1(), len(mfiles),
1920 ', '.join(matches.keys())))
1925 ', '.join(mfiles)))
1921
1926
1922 def write(self, path, data, flags='', **kwargs):
1927 def write(self, path, data, flags='', **kwargs):
1923 if data is None:
1928 if data is None:
@@ -218,8 +218,25 b' Test reporting of path conflicts'
218
218
219 $ hg rebase -r . -d 5
219 $ hg rebase -r . -d 5
220 rebasing 7:855e9797387e "added a back!" (tip)
220 rebasing 7:855e9797387e "added a back!" (tip)
221 abort: error: file 'a' cannot be written because 'a/' is a folder in 9b94b9373deb (containing 1 entries: a/a)
221 saved backup bundle to $TESTTMP/repo1/repo2/.hg/strip-backup/855e9797387e-81ee4c5d-rebase.hg
222 [255]
222
223 $ hg tglog
224 @ 7: bb3f02be2688 'added a back!'
225 |
226 | o 6: d14530e5e3e6 'added bar'
227 | |
228 o | 5: 9b94b9373deb 'added foo'
229 |/
230 o 4: c6ad37a4f250 'a/a'
231 |
232 | o 3: 844a7de3e617 'c'
233 | |
234 o | 2: 09c044d2cb43 'd'
235 | |
236 o | 1: fc055c3b4d33 'b'
237 |/
238 o 0: b173517d0057 'a'
239
223
240
224 $ cd ..
241 $ cd ..
225
242
General Comments 0
You need to be logged in to leave comments. Login now