Mercurial > hg
comparison hgext/largefiles/lfcommands.py @ 30269:d71db0e3b7b9
largefiles: clarify variable name holding file mode
A follow-up to c01acee367ec.
'st' sounds like the whole stat result while 'mode' is a better name for the
actual file mode.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Tue, 18 Oct 2016 16:45:39 +0200 |
parents | c01acee367ec |
children | c93cdfa131a8 |
comparison
equal
deleted
inserted
replaced
30268:dc7c4dbc1af9 | 30269:d71db0e3b7b9 |
---|---|
508 # Synchronize largefile dirstate to the last modified | 508 # Synchronize largefile dirstate to the last modified |
509 # time of the file | 509 # time of the file |
510 lfdirstate.normal(lfile) | 510 lfdirstate.normal(lfile) |
511 update1 = 1 | 511 update1 = 1 |
512 | 512 |
513 # copy the state of largefile standin from the repository's | 513 # copy the exec mode of largefile standin from the repository's |
514 # dirstate to its state in the lfdirstate. | 514 # dirstate to its state in the lfdirstate. |
515 rellfile = lfile | 515 rellfile = lfile |
516 relstandin = lfutil.standin(lfile) | 516 relstandin = lfutil.standin(lfile) |
517 if wvfs.exists(relstandin): | 517 if wvfs.exists(relstandin): |
518 # exec is decided by the users permissions using mask 0o100 | |
518 standinexec = wvfs.stat(relstandin).st_mode & 0o100 | 519 standinexec = wvfs.stat(relstandin).st_mode & 0o100 |
519 st = wvfs.stat(rellfile).st_mode | 520 st = wvfs.stat(rellfile) |
520 if standinexec != st & 0o100: | 521 mode = st.st_mode |
521 st &= ~0o111 | 522 if standinexec != mode & 0o100: |
523 # first remove all X bits, then shift all R bits to X | |
524 mode &= ~0o111 | |
522 if standinexec: | 525 if standinexec: |
523 st |= (st >> 2) & 0o111 & ~util.umask | 526 mode |= (mode >> 2) & 0o111 & ~util.umask |
524 wvfs.chmod(rellfile, st) | 527 wvfs.chmod(rellfile, mode) |
525 update1 = 1 | 528 update1 = 1 |
526 | 529 |
527 updated += update1 | 530 updated += update1 |
528 | 531 |
529 lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup) | 532 lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup) |