This is an archive of the discontinued Mercurial Phabricator instance.

diff: make `hg diff --root=subrepo` work
ClosedPublic

Authored by martinvonz on Feb 8 2019, 3:30 AM.

Details

Summary

The root prefix is currently stripped before adding the subrepo
prefix. It seems to me that if you run hg diff --root=subrepo and a
subrepo/ path is visited (say "subrepo/foo"), then the path generated
for the diff would initially be just "foo" and we then fail (if the
developer warning is active) to strip the "subrepo/" from the path. It
seems like we should first add the prefix in order to produce a path
that's relative to the top-level repo, and then we can remove the root
prefix from that. There are no tests for this, it seems, and I don't
care enough to add one.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Feb 8 2019, 3:30 AM
This revision was automatically updated to reflect the committed changes.