Comments
Patch
@@ -716,10 +716,17 @@
default='relpath'):
match = oldmatch(ctx, pats, opts, globbed, default)
m = copy.copy(match)
+
+ # revert supports recursing into subrepos, and though largefiles
+ # currently doesn't work correctly in that case, this match is
+ # called, so the lfdirstate above may not be the correct one for
+ # this invocation of match.
+ lfdirstate = lfutil.openlfdirstate(ctx._repo.ui, ctx._repo)
+
def tostandin(f):
if lfutil.standin(f) in ctx:
return lfutil.standin(f)
- elif lfutil.standin(f) in repo[None]:
+ elif lfutil.standin(f) in repo[None] or lfdirstate[f] == 'r':
return None
return f
m._files = [tostandin(f) for f in m._files]
@@ -362,6 +362,14 @@
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg status -S
+ $ hg forget -v subrepo/large.txt
+ removing subrepo/large.txt (glob)
+
+Test reverting a forgotten file
+ $ hg revert -R subrepo subrepo/large.txt
+ $ hg status -SA subrepo/large.txt
+ C subrepo/large.txt
+
$ hg rm -v subrepo/large.txt
removing subrepo/large.txt (glob)
$ hg revert -R subrepo subrepo/large.txt