Adding HG_DEST for post-clone hook

Roger Pate rogerpate at gmail.com
Tue Jan 8 01:01:13 UTC 2019


On Mon, Jan 7, 2019 at 9:27 AM anatoly techtonik <techtonik at gmail.com> wrote:
> On Sun, Jan 6, 2019 at 10:05 PM Roger Pate <rogerpate at gmail.com> wrote:
> > On Thu, Jan 3, 2019 at 8:08 AM anatoly techtonik <techtonik at gmail.com> wrote:
> > > I need to `cd` into cloned dir to do some automatic settings,
> > > but location of the new clone is not available.
> > ...
> > > Taken from https://gitlab.com/snippets/1794395
> >
> > What's the working directory for the post-clone hook?
>
> Yes. Name could be different, of course.

That wasn't a yes/no question, but apparently clone hooks act
differently than other hooks, in this regard.  Looking at CWD would
answer your question for other hooks.

> > Why do you want to set ui.username per repository on clone instead of
> > in ~/.hgrc?
>
> Because different organizations require different emails.

Clear ui.username from ~/.hgrc (because you don't want a default) and
then there's no longer a problem -- you can't commit without setting a
username first.

If you know how to guess the username you should use, how about a
pre-commit hook which 1) does nothing if ui.username is set, 2) sets
ui.username for the repo (if it can), or 3) prints an error message
that ui.username is not set and cannot be guessed.



More information about the Mercurial mailing list