##// END OF EJS Templates
[PATCH] Force "hg clone" to always create a new directory...
mpm@selenic.com -
r523:003df62a default
parent child Browse files
Show More
@@ -82,9 +82,8 b' cat <file> [revision]::'
82 clone [-U] <source> [dest]::
82 clone [-U] <source> [dest]::
83 Create a copy of an existing repository in a new directory.
83 Create a copy of an existing repository in a new directory.
84
84
85 If the destination directory is specified but doesn't exist, it is
85 If no destination directory name is specified, it defaults to the
86 created. If no destination directory is specified, it defaults to the
86 basename of the source.
87 current directory.
88
87
89 The source is added to the new repository's .hg/hgrc file to be used in
88 The source is added to the new repository's .hg/hgrc file to be used in
90 future pulls.
89 future pulls.
@@ -272,10 +272,12 b' def clone(ui, source, dest = None, **opt'
272 success = created = False
272 success = created = False
273
273
274 if dest is None:
274 if dest is None:
275 dest = os.getcwd()
275 dest = os.path.basename(source)
276 elif not os.path.exists(dest):
276 if dest == source:
277 os.mkdir(dest)
277 ui.warn('abort: source and destination are the same\n')
278 created = True
278 sys.exit(1)
279
280 os.mkdir(dest)
279
281
280 try:
282 try:
281 dest = os.path.realpath(dest)
283 dest = os.path.realpath(dest)
General Comments 0
You need to be logged in to leave comments. Login now