Show More
@@ -351,12 +351,13 b' def copy(ui, repo, pats, opts, rename=Fa' | |||||
351 |
|
351 | |||
352 | def walkpat(pat): |
|
352 | def walkpat(pat): | |
353 | srcs = [] |
|
353 | srcs = [] | |
|
354 | badstates = after and '?' or '?r' | |||
354 | m = match(repo, [pat], opts, globbed=True) |
|
355 | m = match(repo, [pat], opts, globbed=True) | |
355 | for abs in repo.walk(m): |
|
356 | for abs in repo.walk(m): | |
356 | state = repo.dirstate[abs] |
|
357 | state = repo.dirstate[abs] | |
357 | rel = m.rel(abs) |
|
358 | rel = m.rel(abs) | |
358 | exact = m.exact(abs) |
|
359 | exact = m.exact(abs) | |
359 |
if state in |
|
360 | if state in badstates: | |
360 | if exact and state == '?': |
|
361 | if exact and state == '?': | |
361 | ui.warn(_('%s: not copying - file is not managed\n') % rel) |
|
362 | ui.warn(_('%s: not copying - file is not managed\n') % rel) | |
362 | if exact and state == 'r': |
|
363 | if exact and state == 'r': |
@@ -23,6 +23,14 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 when src and tgt already tracked' | |||
|
27 | mv d1/d11/a1 d2/c | |||
|
28 | hg addrem | |||
|
29 | hg rename --after d1/d11/a1 d2/c | |||
|
30 | hg status -C | |||
|
31 | hg update -C | |||
|
32 | rm d2/c | |||
|
33 | ||||
26 | echo "# rename --after a single file to a nonexistant target filename" |
|
34 | echo "# rename --after a single file to a nonexistant target filename" | |
27 | hg rename --after d1/a dummy |
|
35 | hg rename --after d1/a dummy | |
28 |
|
36 |
@@ -8,6 +8,13 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 when src and tgt already tracked | |||
|
12 | removing d1/d11/a1 | |||
|
13 | adding d2/c | |||
|
14 | A d2/c | |||
|
15 | d1/d11/a1 | |||
|
16 | R d1/d11/a1 | |||
|
17 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
11 | # rename --after a single file to a nonexistant target filename |
|
18 | # rename --after a single file to a nonexistant target filename | |
12 | d1/a: not recording move - dummy does not exist |
|
19 | d1/a: not recording move - dummy does not exist | |
13 | # move a single file to an existing directory |
|
20 | # move a single file to an existing directory |
General Comments 0
You need to be logged in to leave comments.
Login now