Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 562:be6233a2bfdd
hg clone: only use the absolute path for .hg/hgrc
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
hg clone: only use the absolute path for .hg/hgrc
manifest hash: 7fb6a265249a3c910c0321eb1efc61c38429ac91
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCxZ5mywK+sNU5EO8RApIwAJwKdex+GwoflS8vKY9h7qA1F4/Z8wCgjkWH
VsKsuPsM97sluArdDZLZsbs=
=0g6X
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Fri, 01 Jul 2005 11:49:58 -0800 |
parents | cdddf4652aec |
children | 5291a16324c0 |
comparison
equal
deleted
inserted
replaced
561:cdddf4652aec | 562:be6233a2bfdd |
---|---|
294 shutil.rmtree(self.dir, True) | 294 shutil.rmtree(self.dir, True) |
295 | 295 |
296 d = dircleanup(dest) | 296 d = dircleanup(dest) |
297 | 297 |
298 link = 0 | 298 link = 0 |
299 abspath = source | |
299 if not (source.startswith("http://") or | 300 if not (source.startswith("http://") or |
300 source.startswith("hg://") or | 301 source.startswith("hg://") or |
301 source.startswith("old-http://")): | 302 source.startswith("old-http://")): |
302 source = os.path.abspath(source) | 303 abspath = os.path.abspath(source) |
303 d1 = os.stat(dest).st_dev | 304 d1 = os.stat(dest).st_dev |
304 d2 = os.stat(source).st_dev | 305 d2 = os.stat(source).st_dev |
305 if d1 == d2: link = 1 | 306 if d1 == d2: link = 1 |
306 | 307 |
307 if link: | 308 if link: |
321 cg = other.changegroup(fetch) | 322 cg = other.changegroup(fetch) |
322 repo.addchangegroup(cg) | 323 repo.addchangegroup(cg) |
323 | 324 |
324 f = repo.opener("hgrc", "w") | 325 f = repo.opener("hgrc", "w") |
325 f.write("[paths]\n") | 326 f.write("[paths]\n") |
326 f.write("default = %s\n" % source) | 327 f.write("default = %s\n" % abspath) |
327 | 328 |
328 if not opts['noupdate']: | 329 if not opts['noupdate']: |
329 update(ui, repo) | 330 update(ui, repo) |
330 | 331 |
331 d.close() | 332 d.close() |