##// END OF EJS Templates
largefiles: use "normallookup" on "lfdirstate" while reverting...
FUJIWARA Katsunori -
r21934:0cb34b39 stable
parent child Browse files
Show More
@@ -435,7 +435,8 b' def downloadlfiles(ui, repo, rev=None):'
435 ui.status(_("%d largefiles failed to download\n") % totalmissing)
435 ui.status(_("%d largefiles failed to download\n") % totalmissing)
436 return totalsuccess, totalmissing
436 return totalsuccess, totalmissing
437
437
438 def updatelfiles(ui, repo, filelist=None, printmessage=True):
438 def updatelfiles(ui, repo, filelist=None, printmessage=True,
439 normallookup=False):
439 wlock = repo.wlock()
440 wlock = repo.wlock()
440 try:
441 try:
441 lfdirstate = lfutil.openlfdirstate(ui, repo)
442 lfdirstate = lfutil.openlfdirstate(ui, repo)
@@ -516,7 +517,7 b' def updatelfiles(ui, repo, filelist=None'
516 else:
517 else:
517 state, mtime = '?', -1
518 state, mtime = '?', -1
518 if state == 'n':
519 if state == 'n':
519 if mtime < 0:
520 if normallookup or mtime < 0:
520 # state 'n' doesn't ensure 'clean' in this case
521 # state 'n' doesn't ensure 'clean' in this case
521 lfdirstate.normallookup(lfile)
522 lfdirstate.normallookup(lfile)
522 else:
523 else:
@@ -667,7 +667,13 b' def overriderevert(orig, ui, repo, *pats'
667
667
668 newstandins = lfutil.getstandinsstate(repo)
668 newstandins = lfutil.getstandinsstate(repo)
669 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
669 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
670 lfcommands.updatelfiles(ui, repo, filelist, printmessage=False)
670 # lfdirstate should be 'normallookup'-ed for updated files,
671 # because reverting doesn't touch dirstate for 'normal' files
672 # when target revision is explicitly specified: in such case,
673 # 'n' and valid timestamp in dirstate doesn't ensure 'clean'
674 # of target (standin) file.
675 lfcommands.updatelfiles(ui, repo, filelist, printmessage=False,
676 normallookup=True)
671
677
672 finally:
678 finally:
673 wlock.release()
679 wlock.release()
@@ -79,4 +79,24 b' Test that "hg merge" updates largefiles '
79 $ cat .hglf/large1
79 $ cat .hglf/large1
80 58e24f733a964da346e2407a2bee99d9001184f5
80 58e24f733a964da346e2407a2bee99d9001184f5
81
81
82 Test that "hg revert -r REV" updates largefiles from "REV" correctly
83
84 $ hg update -q -C 3
85 $ hg status -A large1
86 C large1
87 $ cat large1
88 large1 in #3
89 $ cat .hglf/large1
90 e5bb990443d6a92aaf7223813720f7566c9dd05b
91 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
92 -4669e532d5b2c093a78eca010077e708a071bb64
93 +58e24f733a964da346e2407a2bee99d9001184f5
94 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
95 $ hg status -A large1
96 M large1
97 $ cat large1
98 large1 in #1
99 $ cat .hglf/large1
100 58e24f733a964da346e2407a2bee99d9001184f5
101
82 $ cd ..
102 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now