newer monotone has changed and wont get recognized
Bug #50549 reported by
ronny
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PIDA |
Fix Released
|
High
|
Ali Afshar |
Bug Description
monotone v0.26 and later are incombatible to earlyer versions - they use a new directory-sheme
Changed in pida: | |
importance: | Untriaged → High |
status: | Unconfirmed → Fix Committed |
assignee: | nobody → aafshar |
To post a comment you must log in.
=== modified file 'pida/utils/ vc/monotone. py' vc/monotone. py vc/monotone. py
--- pida/utils/
+++ pida/utils/
@@ -23,24 +23,39 @@
### THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import os
-import re
-import time
import _vc
class Vc(_vc.Vc): STRIP_NUM = 0 9a-f]{40, 40}$"
- CMD = "monotone"
+ CMD = "mtn"
NAME = "Monotone"
PATCH_
PATCH_INDEX_RE = "^[+]{3,3} ([^ ]*)\t[0-
def __init__(self, location):
self. _tree_cache = None dirname( location) normpath( location) join(where, tofind) dirname( where) location, "_MTN") location, "MT")
- while location != "/":
- if os.path.isdir( "%s/MT" % location):
- self.root = location
- return
- location = os.path.
+ location = os.path.
+
+ def find_folder(where, tofind):
+ while where != "/":
+ cur = os.path.
+ if os.path.isdir(cur):
+ return where
+ where = os.path.
+
+ # for monotone >= 0.26
+ mtn = find_folder(
+ if mtn:
+ self.root = mtn
+ return
+
+ # for monotone <= 0.25 (different metadata directory, different executable)
+ mt = find_folder(
+ if mt:
+ self.root = mt
+ self.CMD = "monotone"
+ return
+
raise ValueError
def commit_ command( self, message): ).read( ).split( "\n")[: -1] %(self. root,self. CMD)).read( ).split( "\n")[: -1]
break
@@ -69,7 +84,7 @@
def lookup_tree(self):
while 1:
try:
- entries = os.popen("monotone automate inventory"
+ entries = os.popen("cd %s && %s automate inventory"
except OSError, e:
if e.errno != errno.EAGAIN: