# HG changeset patch # User mpm@selenic.com # Date 1118803073 28800 # Node ID 1e091b3293d5d843594fac9fe0c44a3d99ee34a9 # Parent c3d873ef4b31c4b84e5147d0881745532517d8d6 default path support with .hg/hgrc -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 default path support with .hg/hgrc hg init creates a new .hgrc file containing a default path pointing to where we pulled from. hg pull now uses "default" as the default source. manifest hash: 0908e3b0648f92a63a3b58e49107cedf07ca0fb4 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCr5SBywK+sNU5EO8RAmvRAKCPdItvtxYyAOgG24732J7PZMFnVgCfe21B MoilYzCQi5GOswS2mk0aE6M= =Gude -----END PGP SIGNATURE----- diff -r c3d873ef4b31 -r 1e091b3293d5 mercurial/commands.py --- a/mercurial/commands.py Tue Jun 14 18:36:09 2005 -0800 +++ b/mercurial/commands.py Tue Jun 14 18:37:53 2005 -0800 @@ -334,13 +334,20 @@ try: os.remove(".hg/dirstate") except: pass + + repo = hg.repository(ui, ".") + else: repo = hg.repository(ui, ".", create=1) other = hg.repository(ui, source) cg = repo.getchangegroup(other) repo.addchangegroup(cg) else: - hg.repository(ui, ".", create=1) + 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""" @@ -409,7 +416,7 @@ raise "patch failed!" repo.commit(files, text) -def pull(ui, repo, source): +def pull(ui, repo, source="default"): """pull changes from the specified source""" paths = {} for name, path in ui.configitems("paths"):