##// END OF EJS Templates
largefiles: factor out synchronization of lfdirstate for future use
FUJIWARA Katsunori -
r22095:cb62d77c default
parent child Browse files
Show More
@@ -510,26 +510,7 b' def updatelfiles(ui, repo, filelist=None'
510
510
511 updated += update1
511 updated += update1
512
512
513 standin = lfutil.standin(lfile)
513 lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup)
514 if standin in repo.dirstate:
515 stat = repo.dirstate._map[standin]
516 state, mtime = stat[0], stat[3]
517 else:
518 state, mtime = '?', -1
519 if state == 'n':
520 if normallookup or mtime < 0:
521 # state 'n' doesn't ensure 'clean' in this case
522 lfdirstate.normallookup(lfile)
523 else:
524 lfdirstate.normal(lfile)
525 elif state == 'm':
526 lfdirstate.normallookup(lfile)
527 elif state == 'r':
528 lfdirstate.remove(lfile)
529 elif state == 'a':
530 lfdirstate.add(lfile)
531 elif state == '?':
532 lfdirstate.drop(lfile)
533
514
534 lfdirstate.write()
515 lfdirstate.write()
535 if printmessage and lfiles:
516 if printmessage and lfiles:
@@ -363,6 +363,28 b' def getstandinsstate(repo):'
363 standins.append((lfile, hash))
363 standins.append((lfile, hash))
364 return standins
364 return standins
365
365
366 def synclfdirstate(repo, lfdirstate, lfile, normallookup):
367 lfstandin = standin(lfile)
368 if lfstandin in repo.dirstate:
369 stat = repo.dirstate._map[lfstandin]
370 state, mtime = stat[0], stat[3]
371 else:
372 state, mtime = '?', -1
373 if state == 'n':
374 if normallookup or mtime < 0:
375 # state 'n' doesn't ensure 'clean' in this case
376 lfdirstate.normallookup(lfile)
377 else:
378 lfdirstate.normal(lfile)
379 elif state == 'm':
380 lfdirstate.normallookup(lfile)
381 elif state == 'r':
382 lfdirstate.remove(lfile)
383 elif state == 'a':
384 lfdirstate.add(lfile)
385 elif state == '?':
386 lfdirstate.drop(lfile)
387
366 def getlfilestoupdate(oldstandins, newstandins):
388 def getlfilestoupdate(oldstandins, newstandins):
367 changedstandins = set(oldstandins).symmetric_difference(set(newstandins))
389 changedstandins = set(oldstandins).symmetric_difference(set(newstandins))
368 filelist = []
390 filelist = []
General Comments 0
You need to be logged in to leave comments. Login now