install.py

changeset 4307
6a8ec996a49c
parent 4239
4883661fc427
child 4374
627e3d0b4ba1
--- a/install.py	Sat Jul 04 11:50:01 2015 +0200
+++ b/install.py	Sat Jul 04 14:46:40 2015 +0200
@@ -1323,7 +1323,10 @@
     if not fileName:
         return
     
-    os.rename(fileName, fileName + ".orig")
+    try:
+        os.rename(fileName, fileName + ".orig")
+    except EnvironmentError:
+        pass
     try:
         hgOut = subprocess.check_output(["hg", "identify", "-i"])
         if sys.version_info[0] == 3:
@@ -1340,7 +1343,8 @@
             f = open(fileName + ".orig", "r", encoding="utf-8")
         text = f.read()
         f.close()
-        text = text.replace("@@REVISION@@", hgOut)
+        text = text.replace("@@REVISION@@", hgOut)\
+            .replace("@@VERSION@@", "rev_" + hgOut)
         copyToFile(fileName, text)
     else:
         shutil.copy(fileName + ".orig", fileName)

eric ide

mercurial