Show More
@@ -10,7 +10,7 b' from node import *' | |||||
10 | demandload(globals(), "os re sys signal shutil imp") |
|
10 | demandload(globals(), "os re sys signal shutil imp") | |
11 | demandload(globals(), "fancyopts ui hg util lock revlog") |
|
11 | demandload(globals(), "fancyopts ui hg util lock revlog") | |
12 | demandload(globals(), "fnmatch hgweb mdiff random signal time traceback") |
|
12 | demandload(globals(), "fnmatch hgweb mdiff random signal time traceback") | |
13 |
demandload(globals(), " |
|
13 | demandload(globals(), "errno socket version struct atexit sets") | |
14 |
|
14 | |||
15 | class UnknownCommand(Exception): |
|
15 | class UnknownCommand(Exception): | |
16 | """Exception raised if command is not in the command table.""" |
|
16 | """Exception raised if command is not in the command table.""" | |
@@ -610,7 +610,7 b' def clone(ui, source, dest=None, **opts)' | |||||
610 | util.copytree(os.path.join(source, ".hg"), os.path.join(dest, ".hg"), |
|
610 | util.copytree(os.path.join(source, ".hg"), os.path.join(dest, ".hg"), | |
611 | copyfile) |
|
611 | copyfile) | |
612 |
|
612 | |||
613 | for fn in "dirstate", "lock": |
|
613 | for fn in "dirstate", "lock", "hgrc", "localtags": | |
614 | try: |
|
614 | try: | |
615 | os.unlink(os.path.join(dest, ".hg", fn)) |
|
615 | os.unlink(os.path.join(dest, ".hg", fn)) | |
616 | except OSError: |
|
616 | except OSError: | |
@@ -622,16 +622,9 b' def clone(ui, source, dest=None, **opts)' | |||||
622 | repo = hg.repository(ui, dest, create=1) |
|
622 | repo = hg.repository(ui, dest, create=1) | |
623 | repo.pull(other) |
|
623 | repo.pull(other) | |
624 |
|
624 | |||
625 | cfg = ConfigParser.SafeConfigParser() |
|
625 | f = repo.opener("hgrc", "w") | |
626 | try: |
|
626 | f.write("[paths]\n") | |
627 | fp = repo.opener('hgrc', 'r') |
|
627 | f.write("default = %s\n" % abspath) | |
628 | os.unlink(fp.name) |
|
|||
629 | cfg.readfp(fp) |
|
|||
630 | except IOError, inst: |
|
|||
631 | if inst.errno != errno.ENOENT: raise |
|
|||
632 | if not cfg.has_section('paths'): cfg.add_section('paths') |
|
|||
633 | cfg.set('paths', 'default', abspath) |
|
|||
634 | cfg.write(repo.opener('hgrc', 'w')) |
|
|||
635 |
|
628 | |||
636 | if not opts['noupdate']: |
|
629 | if not opts['noupdate']: | |
637 | update(ui, repo) |
|
630 | update(ui, repo) |
General Comments 0
You need to be logged in to leave comments.
Login now