[PATCH 0 of 2 DEFAULT V2] add: support adding explicit files in subrepos

David M. Carr david at carrclan.us
Wed Nov 2 00:33:50 CDT 2011


In the past couple months, there's been a lot of discussion about subrepos,
difficulties in using them today, and the path forward.  Several times, Matt
Mackall has requested that someone assemble a patch to have "hg add"
transparently handle adding explicit files in subrepos.  Thus, here is an
attempt at such a patch.

In my first submission of this patch, I had wrongly assumed that we wanted
subrepos to be fully transparent to the add command.  However, based on Matt's
review of that submission, it seems like the desired change is much more
limited.  It is my intent that in this patch, "hg add" will only add files
in subrepositories if either:
1) the -S/--subrepos option is specified (pre-existing behavior)
or
2) the specified path is an exact match (new behavior)
Thus, if you call "hg add" with no arguments, patterns, or directory arguments,
you will still need to specify -S if you want add to recurse into subrepos.

This is my first attempt at a patch for Mercurial (or any software written in
Python, for that matter).  I welcome any and all comments, critiques, or
suggestions for improvement.


More information about the Mercurial-devel mailing list