MCPcopy Create free account
hub / github.com/git/git / setP4ExecBit

Function setP4ExecBit

git-p4.py:683–697  ·  view source on GitHub ↗

Reopens an already open file and changes the execute bit to match the execute bit setting in the passed in mode.

(file, mode)

Source from the content-addressed store, hash-verified

681
682
683def setP4ExecBit(file, mode):
684 """Reopens an already open file and changes the execute bit to match the
685 execute bit setting in the passed in mode.
686 """
687
688 p4Type = "+x"
689
690 if not isModeExec(mode):
691 p4Type = getP4OpenedType(file)
692 p4Type = re.sub(r'^([cku]?)x(.*)', r'\1\2', p4Type)
693 p4Type = re.sub(r'(.*?\+.*?)x(.*?)', r'\1\2', p4Type)
694 if p4Type[-1] == "+":
695 p4Type = p4Type[0:-1]
696
697 p4_reopen(p4Type, file)
698
699
700def getP4OpenedType(file):

Callers 1

applyCommitMethod · 0.85

Calls 3

isModeExecFunction · 0.85
getP4OpenedTypeFunction · 0.85
p4_reopenFunction · 0.85

Tested by

no test coverage detected