Re: Monotone VCS support



On Mon, 2005-11-21 at 19:13 +0000, Daniel Thompson wrote:
> > Will you maintain the monotone plugin? I won't be able to maintain
> > plugins that I don't use daily. (Currently mercurial and CVS)
> 
> Absolutely, if it breaks I'll fix it.

Please find attached a patch the allows meld to operate correctly with
monotone >= 0.26.

-- 
Daniel Thompson (Merlin) <daniel redfelineninja org uk>
signature.asc? http://www.redfelineninja.dsl.pipex.com/signature.html

Did Sigmund's wife wear Freudian slips?
vc/monotone: Add support for monotone >= 0.26

There were some significant changes to monotone between 0.25
and 0.26. The ones that affect meld/vc are that the name of
the metadata directory changed (MT -> _MTN) and the name of
the executable changes (monotone -> mtn).

We treat 0.26 preferentially by checking for its metadata
directories first but we leave fallbacks so that everthing
still work correctly with older versions of monotone.
Index: meld-1.1.3/vc/monotone.py
===================================================================
--- meld-1.1.3.orig/vc/monotone.py	2006-01-24 23:34:17.000000000 +0000
+++ meld-1.1.3/vc/monotone.py	2006-05-19 13:13:34.282162000 +0100
@@ -29,18 +29,29 @@
 
 
 class Vc(_vc.Vc):
-    CMD = "monotone"
+    CMD = "mtn"
     NAME = "Monotone"
     PATCH_STRIP_NUM = 0
     PATCH_INDEX_RE = "^[+]{3,3} ([^  ]*)\t[0-9a-f]{40,40}$"
 
     def __init__(self, location):
         self._tree_cache = None
+
+        # for monotone >= 0.26
+        while location != "/":
+            if os.path.isdir( "%s/_MTN" % location):
+                self.root = location
+                return
+            location = os.path.dirname(location)
+
+        # for monotone <= 0.25 (different metadata directory, different executable)
         while location != "/":
             if os.path.isdir( "%s/MT" % location):
                 self.root = location
+		self.CMD = "monotone"
                 return
             location = os.path.dirname(location)
+
         raise ValueError
 
     def commit_command(self, message):
@@ -69,7 +80,7 @@
     def lookup_tree(self):
         while 1:
             try:
-                entries = os.popen("monotone automate inventory").read().split("\n")[:-1]
+                entries = os.popen(self.CMD + " automate inventory").read().split("\n")[:-1]
                 break
             except OSError, e:
                 if e.errno != errno.EAGAIN:


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