multiple [paths] sections in .hg/hgrc
TK Soh
teekaysoh at yahoo.com
Sat Sep 3 04:48:12 CDT 2005
* TK Soh <teekaysoh at yahoo.com> wrote:
> I noticed several "[paths]" section in my cloned repos. While it doesn't
> seems
> to affect Hg operation in any way, I wonder if this should be fixed to avoid
> potential confusion. However, it does provide an (unintended?) way to let us
> trace the clone back to the originating repos.
I traced the history a little, and it began to look a bug to me. See if this
patch will do it.
# HG changeset patch
# User TK Soh <teekaysoh at yahoo.com>
# Node ID 6200d77f70772467cc078bd680877202b3482a47
# Parent c165cbf56bb117ebdd226aea950e67b543a665e7
clone: fixed multiple "[paths]" sections in .hg/hgrc
diff -r c165cbf56bb1 -r 6200d77f7077 mercurial/commands.py
--- a/mercurial/commands.py Thu Sep 1 19:13:56 2005
+++ b/mercurial/commands.py Sat Sep 3 09:44:48 2005
@@ -610,7 +610,7 @@
util.copytree(os.path.join(source, ".hg"), os.path.join(dest, ".hg"),
copyfile)
- for fn in "dirstate", "lock":
+ for fn in "hgrc", "dirstate", "lock":
try:
os.unlink(os.path.join(dest, ".hg", fn))
except OSError:
@@ -623,8 +623,8 @@
repo.pull(other)
f = repo.opener("hgrc", "a")
- f.write("\n[paths]\n")
- f.write("default = %s\n" % abspath)
+ f.write("[paths]\n")
+ f.write("default = %s\n\n" % abspath)
if not opts['noupdate']:
update(ui, repo)
diff -r c165cbf56bb1 -r 6200d77f7077 mercurial/localrepo.py
--- a/mercurial/localrepo.py Thu Sep 1 19:13:56 2005
+++ b/mercurial/localrepo.py Sat Sep 3 09:44:48 2005
@@ -39,7 +39,7 @@
os.mkdir(self.join("data"))
f = self.opener("hgrc", "w")
f.write("[web]\n")
- f.write("contact = %s\n" % ui.shortuser(ui.username()))
+ f.write("contact = %s\n\n" % ui.shortuser(ui.username()))
self.dirstate = dirstate.dirstate(self.opener, ui, self.root)
try:
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
More information about the Mercurial
mailing list