[meld] Unsupport ancient monotone versions



commit bc2223c8c662288d4348e009ae10ca2e113fdfdb
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Tue Jun 18 08:13:20 2013 +1000

    Unsupport ancient monotone versions

 meld/vc/monotone.py |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)
---
diff --git a/meld/vc/monotone.py b/meld/vc/monotone.py
index 9485836..384f106 100644
--- a/meld/vc/monotone.py
+++ b/meld/vc/monotone.py
@@ -33,8 +33,9 @@ from . import _vc
 
 
 class Vc(_vc.CachedVc):
+    CMD = "mtn"
     NAME = "Monotone"
-    VC_METADATA = ['MT', '_MTN']
+    VC_DIR = "_MTN"
     PATCH_INDEX_RE = "^[+]{3,3} ([^  ]*)\t[0-9a-f]{40,40}$"
 
     state_map_6 = {
@@ -117,24 +118,15 @@ class Vc(_vc.CachedVc):
 
     def __init__(self, location):
         self.interface_version = 0.0
-        self.choose_monotone_version()
-        super(Vc, self).__init__(os.path.normpath(location))
-
-    def choose_monotone_version(self):
         log = logging.getLogger(__name__)
 
-        try:
-            # for monotone >= 0.26
-            self.VC_DIR = "_MTN"
-            self.CMD = "mtn"
-            self.interface_version = float(_vc.popen([self.CMD, "automate", "interface_version"]).read())
-            if self.interface_version > 9.0:
-                log.error("Unsupported monotone interface version; please "
-                          "report any problems to the Meld mailing list.")
-        except (ValueError, OSError):
-            # for monotone <= 0.25
-            self.VC_DIR = "MT"
-            self.CMD = "monotone"
+        self.interface_version = float(
+            _vc.popen([self.CMD, "automate", "interface_version"]).read())
+        if self.interface_version > 9.0:
+            log.error("Unsupported monotone interface version; please "
+                      "report any problems to the Meld mailing list.")
+
+        super(Vc, self).__init__(os.path.normpath(location))
 
     def commit_command(self, message):
         return [self.CMD,"commit","-m",message]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]