Show More
@@ -396,6 +396,12 b' def copy(ui, repo, pats, opts, rename=Fa' | |||||
396 |
|
396 | |||
397 | if after: |
|
397 | if after: | |
398 | if not exists: |
|
398 | if not exists: | |
|
399 | if rename: | |||
|
400 | ui.warn(_('%s: not recording move - %s does not exist\n') % | |||
|
401 | (relsrc, reltarget)) | |||
|
402 | else: | |||
|
403 | ui.warn(_('%s: not recording copy - %s does not exist\n') % | |||
|
404 | (relsrc, reltarget)) | |||
399 | return |
|
405 | return | |
400 | elif not dryrun: |
|
406 | elif not dryrun: | |
401 | try: |
|
407 | try: |
@@ -19,6 +19,9 b' rm bar' | |||||
19 | hg st -A |
|
19 | hg st -A | |
20 | hg commit -m1 |
|
20 | hg commit -m1 | |
21 |
|
21 | |||
|
22 | echo "# copy --after to a nonexistant target filename" | |||
|
23 | hg cp -A foo dummy | |||
|
24 | ||||
22 | echo "# dry-run; should show that foo is clean" |
|
25 | echo "# dry-run; should show that foo is clean" | |
23 | hg copy --dry-run foo bar |
|
26 | hg copy --dry-run foo bar | |
24 | hg st -A |
|
27 | hg st -A |
@@ -11,6 +11,8 b' A bar' | |||||
11 | # should print a warning that this is not a real copy; foo is added |
|
11 | # should print a warning that this is not a real copy; foo is added | |
12 | bar has not been committed yet, so no copy data will be stored for foo. |
|
12 | bar has not been committed yet, so no copy data will be stored for foo. | |
13 | A foo |
|
13 | A foo | |
|
14 | # copy --after to a nonexistant target filename | |||
|
15 | foo: not recording copy - dummy does not exist | |||
14 | # dry-run; should show that foo is clean |
|
16 | # dry-run; should show that foo is clean | |
15 | C foo |
|
17 | C foo | |
16 | # should show copy |
|
18 | # should show copy |
@@ -23,6 +23,9 b' hg status -C' | |||||
23 | hg update -C |
|
23 | hg update -C | |
24 | rm d2/c |
|
24 | rm d2/c | |
25 |
|
25 | |||
|
26 | echo "# rename --after a single file to a nonexistant target filename" | |||
|
27 | hg rename --after d1/a dummy | |||
|
28 | ||||
26 | echo "# move a single file to an existing directory" |
|
29 | echo "# move a single file to an existing directory" | |
27 | hg rename d1/d11/a1 d2 |
|
30 | hg rename d1/d11/a1 d2 | |
28 | hg status -C |
|
31 | hg status -C |
@@ -8,6 +8,8 b' A d2/c' | |||||
8 | d1/d11/a1 |
|
8 | d1/d11/a1 | |
9 | R d1/d11/a1 |
|
9 | R d1/d11/a1 | |
10 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
10 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
11 | # rename --after a single file to a nonexistant target filename | |||
|
12 | d1/a: not recording move - dummy does not exist | |||
11 | # move a single file to an existing directory |
|
13 | # move a single file to an existing directory | |
12 | A d2/a1 |
|
14 | A d2/a1 | |
13 | d1/d11/a1 |
|
15 | d1/d11/a1 | |
@@ -170,6 +172,8 b' R d1/d11/a1' | |||||
170 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
172 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
171 | # move --after some files under d1 to d2/d21 (glob) |
|
173 | # move --after some files under d1 to d2/d21 (glob) | |
172 | moving d1/a to d2/d21/a |
|
174 | moving d1/a to d2/d21/a | |
|
175 | d1/b: not recording move - d2/d21/b does not exist | |||
|
176 | d1/ba: not recording move - d2/d21/ba does not exist | |||
173 | moving d1/d11/a1 to d2/d21/a1 |
|
177 | moving d1/d11/a1 to d2/d21/a1 | |
174 | A d2/d21/a |
|
178 | A d2/d21/a | |
175 | d1/a |
|
179 | d1/a |
General Comments 0
You need to be logged in to leave comments.
Login now