Comments
Patch
@@ -435,7 +435,8 @@
ui.status(_("%d largefiles failed to download\n") % totalmissing)
return totalsuccess, totalmissing
-def updatelfiles(ui, repo, filelist=None, printmessage=True):
+def updatelfiles(ui, repo, filelist=None, printmessage=True,
+ normallookup=False):
wlock = repo.wlock()
try:
lfdirstate = lfutil.openlfdirstate(ui, repo)
@@ -516,7 +517,7 @@
else:
state, mtime = '?', -1
if state == 'n':
- if mtime < 0:
+ if normallookup or mtime < 0:
# state 'n' doesn't ensure 'clean' in this case
lfdirstate.normallookup(lfile)
else:
@@ -667,7 +667,13 @@
newstandins = lfutil.getstandinsstate(repo)
filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
- lfcommands.updatelfiles(ui, repo, filelist, printmessage=False)
+ # lfdirstate should be 'normallookup'-ed for updated files,
+ # because reverting doesn't touch dirstate for 'normal' files
+ # when target revision is explicitly specified: in such case,
+ # 'n' and valid timestamp in dirstate doesn't ensure 'clean'
+ # of target (standin) file.
+ lfcommands.updatelfiles(ui, repo, filelist, printmessage=False,
+ normallookup=True)
finally:
wlock.release()
@@ -79,4 +79,24 @@
$ cat .hglf/large1
58e24f733a964da346e2407a2bee99d9001184f5
+Test that "hg revert -r REV" updates largefiles from "REV" correctly
+
+ $ hg update -q -C 3
+ $ hg status -A large1
+ C large1
+ $ cat large1
+ large1 in #3
+ $ cat .hglf/large1
+ e5bb990443d6a92aaf7223813720f7566c9dd05b
+ $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
+ -4669e532d5b2c093a78eca010077e708a071bb64
+ +58e24f733a964da346e2407a2bee99d9001184f5
+ $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
+ $ hg status -A large1
+ M large1
+ $ cat large1
+ large1 in #1
+ $ cat .hglf/large1
+ 58e24f733a964da346e2407a2bee99d9001184f5
+
$ cd ..