[PATCH 1 of 1] subrepo: check for dirty warns on missing revision instead of abort
Matt Mackall
mpm at selenic.com
Fri May 13 11:28:02 CDT 2011
On Thu, 2011-05-12 at 20:32 +0200, Friedrich Kastner-Masilko wrote:
> # HG changeset patch
> # User Friedrich Kastner-Masilko <face at snoopie.at>
> # Date 1305203454 -7200
> # Node ID 8afba392a97c2fa6d90576c52d5fe8f8d9818e69
> # Parent b0f97b2589cc1f2c07c415c480c6ed02e347704a
> subrepo: check for dirty warns on missing revision instead of abort
>
> There are certain situations where the user is stuck with an abort-message
> "abort: unknown revision 'rev'!" when dealing with subrepos. One of these
> situations is history-rewrite with rebase or strip.
> If you have e.g. a superrepo referencing the tip revision of a subrepo, and you
> strip away the tip in the subrepo, your superrepo is basically stuck. You can't
> "hg update" away from it, not even with "-C".
>
> The expected behaviour would be to have "hg update -C" pull the subrepo again.
> This is prohibited by the dirty detection in subrepo throwing an exception. This
> patch is fixing this by means of issuing a warning instead. Additionally, a
> subrepo with unknown revision is returned as being dirty.
Ok, I've changed things so that the dirty detection no longer throws a
(pointless) exception.
I've written a quick test where I make a repo with a subrepo, clone it,
strip a revision off the subrepo, then update -C. This successfully
pulls in the missing revision and completes the update with no warning:
-----------
rm -rf a
hg init a
cd a
hg init a
cd a
hg init b
cd b
echo f > f
hg ci -Am0
echo f2 > f
hg ci -Am1
cd ..
echo "b = b" > .hgsub
hg ci -Am0
cd ..
hg clone a a2
cd a2/b
hg up 0
hg strip 1
cd ..
echo =====================
hg sum
echo
hg up -C 0
echo
hg sum
-------------
This test ends like this:
parent: 0:06a65bfe15bd tip
0
branch: default
commit: 1 subrepos <-- dirty because of the strip
update: (current)
pulling subrepo b from /home/oxymoron/a/a/a/b <-- pull in missing rev
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
parent: 0:06a65bfe15bd tip
0
branch: default
commit: (clean) <-- now clean
update: (current)
So I think everything discussed in -this- message is addressed, correct?
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list