##// END OF EJS Templates
largefiles: drop "rel" prefix from filename variables...
Martin von Zweigbergk -
r41709:641c8b66 default
parent child Browse files
Show More
@@ -464,27 +464,26 b' def updatelfiles(ui, repo, filelist=None'
464 464 wvfs = repo.wvfs
465 465 wctx = repo[None]
466 466 for lfile in lfiles:
467 rellfile = lfile
468 rellfileorig = os.path.relpath(
469 scmutil.origpath(ui, repo, wvfs.join(rellfile)),
467 lfileorig = os.path.relpath(
468 scmutil.origpath(ui, repo, wvfs.join(lfile)),
470 469 start=repo.root)
471 relstandin = lfutil.standin(lfile)
472 relstandinorig = os.path.relpath(
473 scmutil.origpath(ui, repo, wvfs.join(relstandin)),
470 standin = lfutil.standin(lfile)
471 standinorig = os.path.relpath(
472 scmutil.origpath(ui, repo, wvfs.join(standin)),
474 473 start=repo.root)
475 if wvfs.exists(relstandin):
476 if (wvfs.exists(relstandinorig) and
477 wvfs.exists(rellfile)):
478 shutil.copyfile(wvfs.join(rellfile),
479 wvfs.join(rellfileorig))
480 wvfs.unlinkpath(relstandinorig)
481 expecthash = lfutil.readasstandin(wctx[relstandin])
474 if wvfs.exists(standin):
475 if (wvfs.exists(standinorig) and
476 wvfs.exists(lfile)):
477 shutil.copyfile(wvfs.join(lfile),
478 wvfs.join(lfileorig))
479 wvfs.unlinkpath(standinorig)
480 expecthash = lfutil.readasstandin(wctx[standin])
482 481 if expecthash != '':
483 482 if lfile not in wctx: # not switched to normal file
484 if repo.dirstate[relstandin] != '?':
485 wvfs.unlinkpath(rellfile, ignoremissing=True)
483 if repo.dirstate[standin] != '?':
484 wvfs.unlinkpath(lfile, ignoremissing=True)
486 485 else:
487 dropped.add(rellfile)
486 dropped.add(lfile)
488 487
489 488 # use normallookup() to allocate an entry in largefiles
490 489 # dirstate to prevent lfilesrepo.status() from reporting
@@ -496,9 +495,9 b' def updatelfiles(ui, repo, filelist=None'
496 495 # lfile is added to the repository again. This happens when a
497 496 # largefile is converted back to a normal file: the standin
498 497 # disappears, but a new (normal) file appears as the lfile.
499 if (wvfs.exists(rellfile) and
498 if (wvfs.exists(lfile) and
500 499 repo.dirstate.normalize(lfile) not in wctx):
501 wvfs.unlinkpath(rellfile)
500 wvfs.unlinkpath(lfile)
502 501 removed += 1
503 502
504 503 # largefile processing might be slow and be interrupted - be prepared
@@ -532,19 +531,18 b' def updatelfiles(ui, repo, filelist=None'
532 531
533 532 # copy the exec mode of largefile standin from the repository's
534 533 # dirstate to its state in the lfdirstate.
535 rellfile = lfile
536 relstandin = lfutil.standin(lfile)
537 if wvfs.exists(relstandin):
534 standin = lfutil.standin(lfile)
535 if wvfs.exists(standin):
538 536 # exec is decided by the users permissions using mask 0o100
539 standinexec = wvfs.stat(relstandin).st_mode & 0o100
540 st = wvfs.stat(rellfile)
537 standinexec = wvfs.stat(standin).st_mode & 0o100
538 st = wvfs.stat(lfile)
541 539 mode = st.st_mode
542 540 if standinexec != mode & 0o100:
543 541 # first remove all X bits, then shift all R bits to X
544 542 mode &= ~0o111
545 543 if standinexec:
546 544 mode |= (mode >> 2) & 0o111 & ~util.umask
547 wvfs.chmod(rellfile, mode)
545 wvfs.chmod(lfile, mode)
548 546 update1 = 1
549 547
550 548 updated += update1
General Comments 0
You need to be logged in to leave comments. Login now