135 os.rename(fileName, fileName + ".orig") |
135 os.rename(fileName, fileName + ".orig") |
136 except EnvironmentError: |
136 except EnvironmentError: |
137 pass |
137 pass |
138 try: |
138 try: |
139 hgOut = subprocess.check_output(["hg", "identify", "-i"]) |
139 hgOut = subprocess.check_output(["hg", "identify", "-i"]) |
140 if sys.version_info[0] == 3: |
140 hgOut = hgOut.decode() |
141 hgOut = hgOut.decode() |
|
142 except (OSError, subprocess.CalledProcessError): |
141 except (OSError, subprocess.CalledProcessError): |
143 hgOut = "" |
142 hgOut = "" |
144 if hgOut: |
143 if hgOut: |
145 hgOut = hgOut.strip() |
144 hgOut = hgOut.strip() |
146 if hgOut.endswith("+"): |
145 if hgOut.endswith("+"): |