Show More
@@ -0,0 +1,17 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | hg init a | |||
|
4 | cd a | |||
|
5 | mkdir a | |||
|
6 | echo a > a/b | |||
|
7 | hg ci -Am m | |||
|
8 | hg rm a | |||
|
9 | hg ci -m m a | |||
|
10 | ||||
|
11 | mkdir a b | |||
|
12 | echo a > a/b | |||
|
13 | hg ci -Am m | |||
|
14 | hg rm a | |||
|
15 | cd b | |||
|
16 | # relative delete | |||
|
17 | hg ci -m m ../a |
@@ -1155,6 +1155,12 b' def commit(ui, repo, commitfunc, pats, o' | |||||
1155 | modified, added, removed = repo.status(match=m)[:3] |
|
1155 | modified, added, removed = repo.status(match=m)[:3] | |
1156 | files = util.sort(modified + added + removed) |
|
1156 | files = util.sort(modified + added + removed) | |
1157 | slist = None |
|
1157 | slist = None | |
|
1158 | ||||
|
1159 | def is_dir(f): | |||
|
1160 | name = f + '/' | |||
|
1161 | i = bisect.bisect(files, name) | |||
|
1162 | return i < len(files) and files[i].startswith(name) | |||
|
1163 | ||||
1158 | for f in m.files(): |
|
1164 | for f in m.files(): | |
1159 | if f == '.': |
|
1165 | if f == '.': | |
1160 | continue |
|
1166 | continue | |
@@ -1164,11 +1170,11 b' def commit(ui, repo, commitfunc, pats, o' | |||||
1164 | try: |
|
1170 | try: | |
1165 | mode = os.lstat(rf)[stat.ST_MODE] |
|
1171 | mode = os.lstat(rf)[stat.ST_MODE] | |
1166 | except OSError: |
|
1172 | except OSError: | |
|
1173 | if is_dir(f): # deleted directory ? | |||
|
1174 | continue | |||
1167 | raise util.Abort(_("file %s not found!") % rel) |
|
1175 | raise util.Abort(_("file %s not found!") % rel) | |
1168 | if stat.S_ISDIR(mode): |
|
1176 | if stat.S_ISDIR(mode): | |
1169 |
|
|
1177 | if not is_dir(f): | |
1170 | i = bisect.bisect(files, name) |
|
|||
1171 | if i >= len(files) or not files[i].startswith(name): |
|
|||
1172 | raise util.Abort(_("no match under directory %s!") |
|
1178 | raise util.Abort(_("no match under directory %s!") | |
1173 | % rel) |
|
1179 | % rel) | |
1174 | elif not (stat.S_ISREG(mode) or stat.S_ISLNK(mode)): |
|
1180 | elif not (stat.S_ISREG(mode) or stat.S_ISLNK(mode)): |
General Comments 0
You need to be logged in to leave comments.
Login now