Show More
@@ -1184,7 +1184,7 b' def copy(ui, repo, pats, opts, rename=Fa' | |||
|
1184 | 1184 | ui.warn(_('%s: not overwriting - %s collides with %s\n') % |
|
1185 | 1185 | (reltarget, repo.pathto(abssrc, cwd), |
|
1186 | 1186 | repo.pathto(prevsrc, cwd))) |
|
1187 | return | |
|
1187 | return True # report a failure | |
|
1188 | 1188 | |
|
1189 | 1189 | # check for overwrites |
|
1190 | 1190 | exists = os.path.lexists(target) |
@@ -1194,7 +1194,7 b' def copy(ui, repo, pats, opts, rename=Fa' | |||
|
1194 | 1194 | repo.dirstate.normalize(abstarget)): |
|
1195 | 1195 | if not rename: |
|
1196 | 1196 | ui.warn(_("%s: can't copy - same file\n") % reltarget) |
|
1197 | return | |
|
1197 | return True # report a failure | |
|
1198 | 1198 | exists = False |
|
1199 | 1199 | samefile = True |
|
1200 | 1200 | |
@@ -1220,7 +1220,7 b' def copy(ui, repo, pats, opts, rename=Fa' | |||
|
1220 | 1220 | hint = _("('hg copy --after' to record the copy)\n") |
|
1221 | 1221 | ui.warn(msg % reltarget) |
|
1222 | 1222 | ui.warn(hint) |
|
1223 | return | |
|
1223 | return True # report a failure | |
|
1224 | 1224 | |
|
1225 | 1225 | if after: |
|
1226 | 1226 | if not exists: |
@@ -1230,7 +1230,7 b' def copy(ui, repo, pats, opts, rename=Fa' | |||
|
1230 | 1230 | else: |
|
1231 | 1231 | ui.warn(_('%s: not recording copy - %s does not exist\n') % |
|
1232 | 1232 | (relsrc, reltarget)) |
|
1233 | return | |
|
1233 | return True # report a failure | |
|
1234 | 1234 | elif not dryrun: |
|
1235 | 1235 | try: |
|
1236 | 1236 | if exists: |
@@ -148,6 +148,7 b' moving a missing file' | |||
|
148 | 148 | copy --after to a nonexistent target filename |
|
149 | 149 | $ hg cp -A foo dummy |
|
150 | 150 | foo: not recording copy - dummy does not exist |
|
151 | [1] | |
|
151 | 152 | |
|
152 | 153 | dry-run; should show that foo is clean |
|
153 | 154 | $ hg copy --dry-run foo bar |
@@ -225,11 +226,13 b' Trying to copy on top of an existing fil' | |||
|
225 | 226 | $ hg copy -A bar foo |
|
226 | 227 | foo: not overwriting - file already committed |
|
227 | 228 | ('hg copy --after --force' to replace the file by recording a copy) |
|
229 | [1] | |
|
228 | 230 | same error without the --after, so the user doesn't have to go through |
|
229 | 231 | two hints: |
|
230 | 232 | $ hg copy bar foo |
|
231 | 233 | foo: not overwriting - file already committed |
|
232 | 234 | ('hg copy --force' to replace the file by recording a copy) |
|
235 | [1] | |
|
233 | 236 | but it's considered modified after a copy --after --force |
|
234 | 237 | $ hg copy -Af bar foo |
|
235 | 238 | $ hg st -AC foo |
@@ -241,5 +244,6 b' mention --force:' | |||
|
241 | 244 | $ hg cp bar xyzzy |
|
242 | 245 | xyzzy: not overwriting - file exists |
|
243 | 246 | ('hg copy --after' to record the copy) |
|
247 | [1] | |
|
244 | 248 | |
|
245 | 249 | $ cd .. |
@@ -71,6 +71,7 b' rename --after a single file to a nonexi' | |||
|
71 | 71 | |
|
72 | 72 | $ hg rename --after d1/a dummy |
|
73 | 73 | d1/a: not recording move - dummy does not exist |
|
74 | [1] | |
|
74 | 75 | |
|
75 | 76 | move a single file to an existing directory |
|
76 | 77 | |
@@ -268,6 +269,7 b' overwrite existing files (d2/b)' | |||
|
268 | 269 | d2/b: not overwriting - file already committed |
|
269 | 270 | ('hg rename --force' to replace the file by recording a rename) |
|
270 | 271 | moving d1/d11/a1 to d2/d11/a1 |
|
272 | [1] | |
|
271 | 273 | $ hg status -C |
|
272 | 274 | A d2/a |
|
273 | 275 | d1/a |
@@ -338,6 +340,7 b' move --after some files under d1 to d2/d' | |||
|
338 | 340 | d1/b: not recording move - d2/d21/b does not exist |
|
339 | 341 | d1/ba: not recording move - d2/d21/ba does not exist |
|
340 | 342 | moving d1/d11/a1 to d2/d21/a1 |
|
343 | [1] | |
|
341 | 344 | $ hg status -C |
|
342 | 345 | A d2/d21/a |
|
343 | 346 | d1/a |
@@ -372,6 +375,7 b' attempt to overwrite an existing file' | |||
|
372 | 375 | $ hg rename d1/ba d1/ca |
|
373 | 376 | d1/ca: not overwriting - file exists |
|
374 | 377 | ('hg rename --after' to record the rename) |
|
378 | [1] | |
|
375 | 379 | $ hg status -C |
|
376 | 380 | ? d1/ca |
|
377 | 381 | $ hg update -C |
@@ -396,6 +400,7 b' attempt to overwrite an existing broken ' | |||
|
396 | 400 | $ hg rename --traceback d1/ba d1/ca |
|
397 | 401 | d1/ca: not overwriting - file exists |
|
398 | 402 | ('hg rename --after' to record the rename) |
|
403 | [1] | |
|
399 | 404 | $ hg status -C |
|
400 | 405 | ? d1/ca |
|
401 | 406 | $ hg update -C |
@@ -421,6 +426,7 b' do not copy more than one source file to' | |||
|
421 | 426 | $ hg rename d1/* d2/* d3 |
|
422 | 427 | moving d1/d11/a1 to d3/d11/a1 |
|
423 | 428 | d3/b: not overwriting - d2/b collides with d1/b |
|
429 | [1] | |
|
424 | 430 | $ hg status -C |
|
425 | 431 | A d3/a |
|
426 | 432 | d1/a |
General Comments 0
You need to be logged in to leave comments.
Login now