Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 1133:899b619a7eb2
Create [web] section with short username as contact on hg init and hg clone.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sun, 28 Aug 2005 18:27:24 +0200 |
parents | 30ab5b8ee8ec |
children | 78ceaf83f28f |
line wrap: on
line diff
--- a/mercurial/localrepo.py Sun Aug 28 18:13:28 2005 +0200 +++ b/mercurial/localrepo.py Sun Aug 28 18:27:24 2005 +0200 @@ -27,11 +27,6 @@ self.root = os.path.abspath(path) self.ui = ui - - if create: - os.mkdir(self.path) - os.mkdir(self.join("data")) - self.opener = util.opener(self.path) self.wopener = util.opener(self.root) self.manifest = manifest.manifest(self.opener) @@ -39,6 +34,13 @@ self.tagscache = None self.nodetagscache = None + if create: + os.mkdir(self.path) + os.mkdir(self.join("data")) + f = self.opener("hgrc", "w") + f.write("[web]\n") + f.write("contact = %s\n" % ui.shortuser(ui.username())) + self.dirstate = dirstate.dirstate(self.opener, ui, self.root) try: self.ui.readconfig(self.opener("hgrc"))