[PATCH] clone: update to branch of parent for local source repos by default
Adrian Buehlmann
adrian at cadifra.com
Wed Oct 21 08:09:07 UTC 2009
On 21.10.2009 02:01, Greg Ward wrote:
> On Tue, Oct 20, 2009 at 7:01 PM, Adrian Buehlmann <adrian at cadifra.com> wrote:
>> For the record: the idea was
>>
>> $ hg clone -u stable thg-stable thg-stable-bug1234
>> updating to branch stable
>> 297 files updated, 0 files merged, 0 files removed, 0 files unresolved
>>
>> or
>>
>> hg clone -u rev src dest
>>
>> which would checkout revision, tag or branch 'rev'.
>
> That sounds fairly useful. But I think even a tightly focussed option
> would be super useful:
>
> hg clone --update-to-parent-of-source src dest
>
> or
>
> hg clone --update-to-branch-of-source src dest
>
> (They are subtly different in case src is at an old changeset on some
> named branch: should dest be at that exact changeset, or at the
> tipmost changeset on the same branch? I think the latter.)
>
> Note that I am not seriously proposing either of the above option
> names, just their semantics. --source-branch perhaps? Either one is
> obviously a special case of your "-u" idea, so not strictly
> necessary... but darned handy, I think.
--source-branch sounds good
(--source-branch could even be specified in [defaults], provided
mercurial would gracefully disregard it without moaning if it had
been specified for a non local source repo.)
My plan for --source-branch was to do the same as
hg clone -u <branch of src's parent> src dest
would do.
That aside, we need 'clone -u' for completeness/versatility's sake.
We should implement that first and see if it has a chance to make
it into 1.4. Matt's messages seem to hint at that.
More information about the Mercurial-devel
mailing list