subrepo wish list

Michael Ekstrand michael at elehack.net
Wed Apr 14 17:18:31 CDT 2010


After working with subrepos in Mercurial for some weeks now, I have been
getting somewhat frustrated with the remaining user experience holes in
them.  But with that, I also have proposals for what would make this
experience better.

The purpose of this message is not to demand "write my feature! fix my
bug!", but rather to share my thoughts based on some subrepos
experience, see if there are already-existing methods to achieve my
goals, and start a conversation about how best to fill these gaps.

For subrepos to be near-perfect for me, two things are missing or "broken":
* Status support is nonexistent, as near as I can tell
* Commit recursively auto-committing doesn't fit well w/ my workflow

For the first, it looks like there has already been some discussion on
doing this and some submitted patches.  It seems to me that there are 3
states a subrepo can be in:
* Unchanged, and thus suppressible from status display
* Changed but committed: the subrepo is changed from a parent repo
perspective, but itself has no uncommitted changes.
* Possibly changed and dirty: the subrepo has uncommitted changes, and
its last checked-in status may or may not be the same as recorded in
.hgsubstate.

Commit is a bit more complicated, and my ideal workflow is not
backwards-compatible.  Right now, commit recursively tries to commit
subrepositories before committing the current repository.  It would be
quite nice if there were an option at least to modify this behavior.  My
workflow would be best served, as near as I can tell, by the following:
* If subrepositories are clean, commit and update .hgsubstate if
necessary.  From a UI perspective, treat directories as files, so I can
commit the updated state of subrepos selectively.
* If subrepos are dirty, fail.  Require a --force option to proceed; in
that case, update .hgsubstate but do not commit the nested repository.
Have another option to do the recursive commit.

Basically, I don't want my subrepos transparently committed for me: I
want to manually commit them every time.

Thoughts?  Is there a way (options I don't know of, extensions, etc.) to
accomplish either or both of these goals currently?  What is involved in
making either of these happen?

Thanks,
- Michael



More information about the Mercurial mailing list