[PATCH 2 of 2 v2] subrepos: make subrepositories sticky

Kevin Bullock kbullock+mercurial at ringworld.org
Wed Jan 26 11:35:52 CST 2011


On Jan 26, 2011, at 6:20 AM, Erik Zielke wrote:

> # HG changeset patch
> # User Erik Zielke <ez at aragost.com>
> # Date 1294241235 -3600
> # Node ID 63c76fed1e6b482eeec7b19496bc673da3cd2038
> # Parent  4c003dc9ab3cd8f379f9f761931bddcf03bce21e
> subrepos: make subrepositories sticky
> 
> Making subrepositories sticky means that if we have the following
> links between main repository and subrepository:
> 
> r0 - s0
> r1 - s1
> r2 - s2
> 
> and have updated so the revisions are not at the linked states, e.g.
> we are at r1 in the main repository and s2 in the sub repository. Then
> when we update the main repository, the subrepository stays at s2,
> unless we use clean when updating.
> 
> Example:
> 
>    Current state: r1/s2
>    hg up 0
>    Current state: r0/s2
>    hg up 0 --clean
>    Current state: r0/s0

I feel a little squirmy about overloading the --clean flag this way. Of course you can always manually update the subrepo to the desired revision; but the only way to discover what that is is to look in .hgsubstate.

On the other hand, I think --clean _should_ update sticky subrepos; I'm just wondering about also providing a flag to use when you want to e.g. keep local changes in the outer repo but update the sticky subrepo to the version in .hgsubstate. But that's starting to sound like a profusion of command-line arguments.

Maybe the overloading of --clean is the best option after all. Just thinking with my fingers to stimulate discussion.

pacem in terris / mir / shanti / salaam / heiwa
Kevin R. Bullock



More information about the Mercurial-devel mailing list