Multiple personalities
Michael Diamond
dimo414 at gmail.com
Wed Apr 4 12:01:19 UTC 2012
On Wed, Apr 4, 2012 at 6:50 AM, Alan Mackenzie <acm at muc.de> wrote:
> At the moment, I cope with this by having two username settings: in
> ~/.hgrc I have (i) and in <repository>/.hg/hgrc I have (ii). Trouble
> is, this username isn't propagated when I clone the repo. So I've got a
> rather clumsy bash script called cc-clone, which copies the username
> from the original repo to the new one.
>
> This doesn't feel optimal. Is there a better solution to this dual
> identity problem?
>
>
~/.hgrc is a convenient location for settings that apply to *all*
repositories you'll work with on that machine. If per-user-per-computer
isn't granular enough, I'd avoid setting your username in ~/.hgrc at all.
This would mean you can't commit with an incorrect username, though it
doesn't resolve the issue of cloning the username over. Personally, it'd
be nice hg clone had a --username flag that copied the username to the
cloned repository (for local repos only), but that might not be ideal.
Another alternative would be an extension that searches up the directory
tree from the repo root til it hits a .hgrc file, and parses this after
~/.hgrc but before .hg/hgrc - this way as long as your clones are all
segregated by directory (all your ACM projects in ~/acm and your GNU
projects in ~/gnu, for instance) it could find ~/acm/.hgrc and use the
username there. Not sure if that's possible, but if it is, it wouldn't be
too hard to implement.
Michael Diamond
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20120404/a2c7dc75/attachment-0002.html>
More information about the Mercurial
mailing list