Show More
@@ -131,7 +131,10 b' def clone(ui, source, dest=None, pull=Fa' | |||||
131 | source = localpath(source) |
|
131 | source = localpath(source) | |
132 |
|
132 | |||
133 | if os.path.exists(dest): |
|
133 | if os.path.exists(dest): | |
|
134 | if not os.path.isdir(dest): | |||
134 | raise util.Abort(_("destination '%s' already exists") % dest) |
|
135 | raise util.Abort(_("destination '%s' already exists") % dest) | |
|
136 | elif os.listdir(dest): | |||
|
137 | raise util.Abort(_("destination '%s' is not empty") % dest) | |||
135 |
|
138 | |||
136 | class DirCleanup(object): |
|
139 | class DirCleanup(object): | |
137 | def __init__(self, dir_): |
|
140 | def __init__(self, dir_): |
@@ -60,4 +60,11 b' echo % use --pull' | |||||
60 | hg clone --pull a g |
|
60 | hg clone --pull a g | |
61 | hg -R g verify |
|
61 | hg -R g verify | |
62 |
|
62 | |||
|
63 | echo | |||
|
64 | echo % clone to '.' | |||
|
65 | mkdir h | |||
|
66 | cd h | |||
|
67 | hg clone ../a . | |||
|
68 | cd .. | |||
|
69 | ||||
63 | exit 0 |
|
70 | exit 0 |
@@ -43,4 +43,10 b' hg init' | |||||
43 | cd .. |
|
43 | cd .. | |
44 | hg clone q |
|
44 | hg clone q | |
45 |
|
45 | |||
|
46 | # destination directory not empty | |||
|
47 | mkdir a | |||
|
48 | echo stuff > a/a | |||
|
49 | hg clone q a | |||
|
50 | echo $? | |||
|
51 | ||||
46 | true |
|
52 | true |
@@ -4,9 +4,11 b' abort: error: Connection refused' | |||||
4 | 255 |
|
4 | 255 | |
5 | abort: repository a not found! |
|
5 | abort: repository a not found! | |
6 | 255 |
|
6 | 255 | |
7 | abort: destination '../a' already exists |
|
7 | abort: Permission denied: ../a | |
8 | 255 |
|
8 | 255 | |
9 | abort: repository a not found! |
|
9 | abort: repository a not found! | |
10 | 255 |
|
10 | 255 | |
11 | destination directory: q |
|
11 | destination directory: q | |
12 |
abort: destination 'q' |
|
12 | abort: destination 'q' is not empty | |
|
13 | abort: destination 'a' is not empty | |||
|
14 | 255 |
@@ -50,3 +50,7 b' checking manifests' | |||||
50 | crosschecking files in changesets and manifests |
|
50 | crosschecking files in changesets and manifests | |
51 | checking files |
|
51 | checking files | |
52 | 2 files, 11 changesets, 11 total revisions |
|
52 | 2 files, 11 changesets, 11 total revisions | |
|
53 | ||||
|
54 | % clone to . | |||
|
55 | updating working directory | |||
|
56 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
General Comments 0
You need to be logged in to leave comments.
Login now