[PATCH 0 of 4 stable] fix diff/status -S for added/removed subrepos (issue3056)

Dov Feldstern dovdevel at gmail.com
Wed Apr 25 10:02:44 UTC 2012


In trying to generate a patch containing all the changes needed for
bringing a non-mercurial copy of a repo from state 1 to state 2, I ran
into the issue where the generated patch did not include any of the
files from a subrepo which had been added between state 1 and state 2.

Searching the bts, I found that this is issue 3056 [1]. That issue
seems to have culminated in a thread [2] in which everyone agrees that
the issue should be fixed, but that's where things were left.

So here are a few patches which solve the issue.

I've added some tests for this to test-subrepo.t. I've also fixed some
existing tests which inadvertently display this issue; note, though,
that not all cases covered by my new tests are covered by the existing
ones. If reducing the number of new tests is an issue, I would suggest
perhaps removing the existing tests for issue3153 [3] (which is
actually a subset of issue3056). All other tests pass, except for
test-gendoc.t, which currently fails even before my patches.

Finally, in reviewing these patches, I sort of feel that with a little
more refactoring --- something along the lines of having itersubrepos
also return the state of each subrepo in ctx2 --- things would be much
simpler from the caller's point of view; however, I'm not sure how
clean that is (it starts becoming hard to explain "what does
itersubrepos (and the more internal functions it calls) actually
do?"); and I wanted to get some feedback before venturing into more
serious refactoring.

Comments welcome.

[1] http://mercurial.selenic.com/bts/issue3056
[2] http://www.selenic.com/pipermail/mercurial-devel/2011-October/035194.html
[3] http://mercurial.selenic.com/bts/issue3153


More information about the Mercurial-devel mailing list