Show More
@@ -716,10 +716,17 b' def overriderevert(orig, ui, repo, *pats' | |||||
716 | default='relpath'): |
|
716 | default='relpath'): | |
717 | match = oldmatch(ctx, pats, opts, globbed, default) |
|
717 | match = oldmatch(ctx, pats, opts, globbed, default) | |
718 | m = copy.copy(match) |
|
718 | m = copy.copy(match) | |
|
719 | ||||
|
720 | # revert supports recursing into subrepos, and though largefiles | |||
|
721 | # currently doesn't work correctly in that case, this match is | |||
|
722 | # called, so the lfdirstate above may not be the correct one for | |||
|
723 | # this invocation of match. | |||
|
724 | lfdirstate = lfutil.openlfdirstate(ctx._repo.ui, ctx._repo) | |||
|
725 | ||||
719 | def tostandin(f): |
|
726 | def tostandin(f): | |
720 | if lfutil.standin(f) in ctx: |
|
727 | if lfutil.standin(f) in ctx: | |
721 | return lfutil.standin(f) |
|
728 | return lfutil.standin(f) | |
722 | elif lfutil.standin(f) in repo[None]: |
|
729 | elif lfutil.standin(f) in repo[None] or lfdirstate[f] == 'r': | |
723 | return None |
|
730 | return None | |
724 | return f |
|
731 | return f | |
725 | m._files = [tostandin(f) for f in m._files] |
|
732 | m._files = [tostandin(f) for f in m._files] |
@@ -362,6 +362,14 b' Test update with subrepos.' | |||||
362 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
362 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
363 | $ hg status -S |
|
363 | $ hg status -S | |
364 |
|
364 | |||
|
365 | $ hg forget -v subrepo/large.txt | |||
|
366 | removing subrepo/large.txt (glob) | |||
|
367 | ||||
|
368 | Test reverting a forgotten file | |||
|
369 | $ hg revert -R subrepo subrepo/large.txt | |||
|
370 | $ hg status -SA subrepo/large.txt | |||
|
371 | C subrepo/large.txt | |||
|
372 | ||||
365 | $ hg rm -v subrepo/large.txt |
|
373 | $ hg rm -v subrepo/large.txt | |
366 | removing subrepo/large.txt (glob) |
|
374 | removing subrepo/large.txt (glob) | |
367 | $ hg revert -R subrepo subrepo/large.txt |
|
375 | $ hg revert -R subrepo subrepo/large.txt |
General Comments 0
You need to be logged in to leave comments.
Login now