Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 528:648386fabf9c
Fix clone bug wth trailing slash
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Fix clone bug wth trailing slash
manifest hash: ca78730f00063c57b70db69cf9ecfc3f83c02e84
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCw4lNywK+sNU5EO8RApq+AJ9YTl92lLnk9UMvWWSeEue/siS6pACgsg68
FLAc0OVzeULP7ORKRHCtpQI=
=IL3R
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Wed, 29 Jun 2005 21:55:25 -0800 |
parents | 58790c83ce52 |
children | 2e9698a5c92c |
comparison
equal
deleted
inserted
replaced
527:58790c83ce52 | 528:648386fabf9c |
---|---|
270 source = ui.expandpath(source) | 270 source = ui.expandpath(source) |
271 | 271 |
272 success = False | 272 success = False |
273 | 273 |
274 if dest is None: | 274 if dest is None: |
275 dest = os.path.basename(source) | 275 dest = os.path.basename(os.path.normpath(source)) |
276 if dest == source: | 276 if dest == source: |
277 ui.warn('abort: source and destination are the same\n') | 277 ui.warn('abort: source and destination are the same\n') |
278 sys.exit(1) | 278 sys.exit(1) |
279 | 279 |
280 os.mkdir(dest) | 280 os.mkdir(dest) |
285 d1 = os.stat(dest).st_dev | 285 d1 = os.stat(dest).st_dev |
286 d2 = os.stat(source).st_dev | 286 d2 = os.stat(source).st_dev |
287 if d1 == d2: link = 1 | 287 if d1 == d2: link = 1 |
288 | 288 |
289 if link: | 289 if link: |
290 ui.debug("copying by hardlink\n") | 290 ui.note("copying by hardlink\n") |
291 util.system("cp -al '%s'/.hg '%s'/.hg" % (source, dest)) | 291 util.system("cp -al '%s'/.hg '%s'/.hg" % (source, dest)) |
292 try: | 292 try: |
293 os.remove(os.path.join(dest, ".hg", "dirstate")) | 293 os.remove(os.path.join(dest, ".hg", "dirstate")) |
294 except: pass | 294 except: pass |
295 | 295 |