Subrepo status/diff/revert

Martin Geisler mg at lazybytes.net
Wed Aug 25 13:54:48 CDT 2010


Tim Henigan <tim.henigan at gmail.com> writes:

> I created a repo on BitBucket for my "subrepo-revert" command [1]. It
> is currently implemented as an extension. Once I am satisfied with the
> design, I will look at wrapping the core revert command.
>
> If you have time to review, I would appreciate it. I will send it to
> the devel list for review once it is complete.

I looked at it and there are some small things you can do. First, you
should replace

  sub_hg = hg.repository(ui, path = subpath)

with

  ctx = repo['.'] # context for the working copy parent revision
  sub = ctx.sub(subpath) # subrepo for subpath

in order to create the right type of subrepository. We support both
Subversion and Mercurial subrepositories -- you will probably want to
test isinstance(sub, hgsubrepo) and act accordingly.

While your extension is definitely helpful, I'm planning something more
integrated, something that will allow me to do

  $ hg revert sub/a.txt

where the paths are crossing subrepository boundaries.

I've moved my patch repository here:

  http://hg.lazybytes.net/subrepos-mq/

and here you can see what I'm currently experiementing with for status:

  http://hg.lazybytes.net/subrepos-mq/file/tip/subrepo-status

It is just a prototype, I still don't know how to best integrate this
with the rest of Mercurial.

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100825/5479679e/attachment.pgp>


More information about the Mercurial-devel mailing list