[PATCH] subrepo: handle missing subrepo spec file as removed

Patrick Mézard pmezard at gmail.com
Wed Nov 17 15:35:37 CST 2010


Le 17/11/10 22:27, Patrick Mezard a écrit :

[...]

> +delete .hgsubstate and update
> +
> +  $ hg up -C
> +  warning: subrepo spec file .hgsub not found
> +  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  $ rm .hgsubstate
> +  $ hg up 0  
> +  remote changed .hgsubstate which local deleted
> +  use (c)hanged version or leave (d)eleted? c
> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  $ hg st
> +  $ ls subrepo
> +  a

The test is interesting because it highlights .hgsubstate magical behaviour : it is first deleted, then on the update the merge machinery kicks in and eventually merge it by restoring and overwriting it.

Also, I am not sure what to expect in the update case:
1- The current situation where the missing .hgsub spec is apparently ignored (I admit I have not investigated the reasons for the merge result)
2- A situation where the missing spec file is considered removed and act accordingly. But if .hgsub is there and .hgsubstate is missing, what should be done?

Not sure all this really matters now, my initial issue was to avoid "breaking" the working directory.

--
Patrick Mézard


More information about the Mercurial-devel mailing list