[PATCH] status: add option to show status of files in subrepos
david.mitchell at telogis.com
Thu Jun 10 15:32:48 CDT 2010
One of the common complaints about subrepos is
> that it's not obvious when a subrepo is modified so commit's recursive
> behavior bites people. So it's not clear that:
> M foo
> M sub/bar
> really gives people enough notice that it's a subrepo that's changed.
> But then:
> M foo
> M subrepo/
> is just weird, so maybe your way is right after all. Opinions?
I think perhaps it would make sense to introduce some sort of convention for
this, I don't think the current forms are expressive enough. Something
similar to one of these perhaps:
A little arcane, so maybe:
S sub M bar
S baz/sub2 M qux
That maybe makes more sense because the sub or baz/sub2 entries in
.hgsubstate will be changed, as well as the bar/qux files being modified in
their respective repos. Spaces become a problem so maybe some sort of
delimiter is necessary.
> Is there a reason not to have a -S flag?
Not a good one ;) I'll add it.
> That's a little hard to read. Perhaps something like
> for sub in subrepos:
> substat = ctx2.sub(sub).status()
> for i, l in enumerate(substat):
> s[i].append('%s/%s' % (sub, f) for f in l)
> Thanks, my python-fu is still rudimentary so that's helpful to know about.
> There are things that expect these lists to be sorted, so we're going to
> need an extra step here. And merging the sorted file lists from the main
> repo and N subrepos efficiently can probably be done more efficiently
> than sort(sum(lists)).
I believe this is already correctly sorted, because the second to last line
in the status method performs a sort on each array.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mercurial-devel