[PATCH] clone: update to branch of parent for local source repos by default

Adrian Buehlmann adrian at cadifra.com
Wed Oct 21 04:03:12 CDT 2009


On 21.10.2009 10:17, Peter Arrenbrecht wrote:
> On Wed, Oct 21, 2009 at 10:09 AM, Adrian Buehlmann <adrian at cadifra.com> wrote:
>> --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.
> 
> I guess `hg clone -u . src dest` should cover most scenarios where
> people would have wanted --source-branch.
>

Excellent.

So . is in scope. Neat.

Compare existing:

$ hg -R thg-stable par
changeset:   3536:cd50b769e235
branch:      stable
tag:         0.8.3
user:        Steve Borho <steve at borho.org>
date:        Tue Oct 06 22:07:28 2009 -0500
summary:     hgtk: correct arguments to dispatch() when launching qct

$ hg clone -r . thg-stable thg-stable-bug1234
requesting all changes
adding changesets
adding manifests
adding file changes
added 3537 changesets with 5456 changes to 522 files
updating to branch stable
297 files updated, 0 files merged, 0 files removed, 0 files unresolved

Planned (faking output):

$ hg clone -u . thg-stable thg-stable-bug1235
updating to branch stable
297 files updated, 0 files merged, 0 files removed, 0 files unresolved

> For folks who want to put "-u ." into [defaults], we should make sure
> that -U still disables it.

Good point.

-U should gracefully and silently override -u without mercurial moaning
at it (or at least not moan by default, i.e. without --verbose).





More information about the Mercurial-devel mailing list