Update and missing file in subrepo - a bug?

Matt Mackall mpm at selenic.com
Wed Feb 22 22:17:19 UTC 2012


On Wed, 2012-02-22 at 22:55 +0100, Michał Sznajder wrote:
> One of the users of THG reported [1] that update of the main
> repository with a deleted file in the subrepo does not bring back file
> in subrepo. Below is a way to reproduce this:
> 
> hg init test
> cd test
> hg init subrepo
> echo "subrepo = subrepo" > .hgsub
> echo a > subrepo/file
> hg -R subrepo commit --addremove --message "subrepo commit"
> hg commit --addremove --message "commit"
> # delete file
> rm subrepo/file
> hg update
> hg status --subrepos
> ! subrepo/file
> 
> IMHO this is wrong: file should be brought back. Should I file a bug?

It matches the behavior of 'hg update' on deleted files without
subrepos, and that behavior is intentional.

What? Intentional?

Yes, normal update merges local uncommitted changes with the updated-to
target. And deleted files (whether tracked or not) are such a change. We
don't assume deleted files are an accident; we assume they are files
which the user has not yet run 'hg rm' on.

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list