139 return |
139 return |
140 |
140 |
141 with contextlib.suppress(OSError): |
141 with contextlib.suppress(OSError): |
142 os.rename(fileName, fileName + ".orig") |
142 os.rename(fileName, fileName + ".orig") |
143 try: |
143 try: |
144 hgOut = subprocess.check_output(["hg", "identify", "-i"]) # secok |
144 hgOut = subprocess.run( # secok |
145 hgOut = hgOut.decode() |
145 ["hg", "identify", "-i"], check=True, |
|
146 capture_output=True, text=True |
|
147 ).stdout |
146 except (OSError, subprocess.CalledProcessError): |
148 except (OSError, subprocess.CalledProcessError): |
147 hgOut = "" |
149 hgOut = "" |
148 if hgOut: |
150 if hgOut: |
149 hgOut = hgOut.strip() |
151 hgOut = hgOut.strip() |
150 if hgOut.endswith("+"): |
152 if hgOut.endswith("+"): |