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