# HG changeset patch # User Thomas Arendsen Hein # Date 1119017132 -3600 # Node ID 50aea13227a21b7e30bfd97b4b4402e386c437c2 # Parent ef8ff43f9c11deb91c8205d5b12ca2505a9d46c3 create .hg/hgrc with [paths] default entry only if source was given on hg init. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 create .hg/hgrc with [paths] default entry only if source was given on hg init. manifest hash: 8229e52ba4d3a6be51e053986230d195cff78966 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCstisW7P1GVgWeRoRAqaVAJ0SK+3Sjki5OD61bCZj1HEo5hYcsQCfRV0z MJpYg9kiWJg8a4CzASoa+Hs= =Ql0q -----END PGP SIGNATURE----- diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -384,13 +384,13 @@ def init(ui, source=None): other = hg.repository(ui, source) cg = repo.getchangegroup(other) repo.addchangegroup(cg) + + f = repo.opener("hgrc", "w") + f.write("[paths]\n") + f.write("default = %s\n" % source) else: repo = hg.repository(ui, ".", create=1) - f = repo.opener("hgrc", "w") - f.write("[paths]\n") - f.write("default = %s\n" % source) - def log(ui, repo, f): """show the revision history of a single file""" f = relpath(repo, [f])[0]