[meld] Set the cwd when checking repository validity (closes bgo#650250)



commit 9da095e9c1d330e5e78474633c76c7efcbb4693b
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Tue May 24 18:15:12 2011 +1000

    Set the cwd when checking repository validity (closes bgo#650250)

 meld/vc/bzr.py       |    2 +-
 meld/vc/cvs.py       |    2 +-
 meld/vc/darcs.py     |    2 +-
 meld/vc/fossil.py    |    2 +-
 meld/vc/git.py       |    5 +++--
 meld/vc/mercurial.py |    2 +-
 meld/vc/monotone.py  |    2 +-
 meld/vc/svn.py       |    2 +-
 meld/vc/tla.py       |    2 +-
 9 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/meld/vc/bzr.py b/meld/vc/bzr.py
index a54490e..3e4f36b 100644
--- a/meld/vc/bzr.py
+++ b/meld/vc/bzr.py
@@ -67,7 +67,7 @@ class Vc(_vc.CachedVc):
     def resolved_command(self):
         return [self.CMD] + self.CMDARGS + ["resolve"]
     def valid_repo(self):
-        if _vc.call([self.CMD, "check", "--tree", "--branch"]):
+        if _vc.call([self.CMD, "check", "--tree", "--branch"], cwd=self.root):
             return False
         else:
             return True
diff --git a/meld/vc/cvs.py b/meld/vc/cvs.py
index b612fe5..fbf9b56 100644
--- a/meld/vc/cvs.py
+++ b/meld/vc/cvs.py
@@ -57,7 +57,7 @@ class Vc(_vc.Vc):
     def revert_command(self):
         return [self.CMD,"update","-C"]
     def valid_repo(self):
-        if _vc.call([self.CMD, "version"]):
+        if _vc.call([self.CMD, "version"], cwd=self.root):
             return False
         else:
             return True
diff --git a/meld/vc/darcs.py b/meld/vc/darcs.py
index 6c1070c..5224d75 100644
--- a/meld/vc/darcs.py
+++ b/meld/vc/darcs.py
@@ -71,7 +71,7 @@ class Vc(_vc.CachedVc):
         return [self.CMD, "resolve"]
 
     def valid_repo(self):
-        if _vc.call([self.CMD, "query", "tags"]):
+        if _vc.call([self.CMD, "query", "tags"], cwd=self.root):
             return False
         else:
             return True
diff --git a/meld/vc/fossil.py b/meld/vc/fossil.py
index 8559ee6..3908cb1 100644
--- a/meld/vc/fossil.py
+++ b/meld/vc/fossil.py
@@ -63,7 +63,7 @@ class Vc(_vc.CachedVc):
         return [self.CMD, "revert"]
 
     def valid_repo(self):
-        if _vc.call([self.CMD, "info"]):
+        if _vc.call([self.CMD, "info"], cwd=self.root):
             return False
         else:
             return True
diff --git a/meld/vc/git.py b/meld/vc/git.py
index 9b8ec94..bfa5a7e 100644
--- a/meld/vc/git.py
+++ b/meld/vc/git.py
@@ -67,7 +67,7 @@ class Vc(_vc.CachedVc):
     def revert_command(self):
         return [self.CMD,"checkout"]
     def valid_repo(self):
-        if _vc.call([self.CMD, "branch"]):
+        if _vc.call([self.CMD, "branch"], cwd=self.root):
             return False
         else:
             return True
@@ -83,7 +83,8 @@ class Vc(_vc.CachedVc):
             try:
                 # Update the index before getting status, otherwise we could
                 # be reading stale status information
-                _vc.popen(["git", "update-index", "--refresh"])
+                _vc.popen(["git", "update-index", "--refresh"],
+                          cwd=self.location)
 
                 # Get the status of files that are different in the "index" vs
                 # the HEAD of the git repository
diff --git a/meld/vc/mercurial.py b/meld/vc/mercurial.py
index 77665cc..49860b6 100644
--- a/meld/vc/mercurial.py
+++ b/meld/vc/mercurial.py
@@ -60,7 +60,7 @@ class Vc(_vc.Vc):
     def revert_command(self):
         return [self.CMD,"revert"]
     def valid_repo(self):
-        if _vc.call([self.CMD, "root"]):
+        if _vc.call([self.CMD, "root"], cwd=self.root):
             return False
         else:
             return True
diff --git a/meld/vc/monotone.py b/meld/vc/monotone.py
index 7d504c8..5867bc0 100644
--- a/meld/vc/monotone.py
+++ b/meld/vc/monotone.py
@@ -144,7 +144,7 @@ class Vc(_vc.CachedVc):
     def resolved_command(self):
         return [self.CMD,"resolved"]
     def valid_repo(self):
-        if _vc.call([self.CMD, "list", "tags"]):
+        if _vc.call([self.CMD, "list", "tags"], cwd=self.root):
             return False
         else:
             return True
diff --git a/meld/vc/svn.py b/meld/vc/svn.py
index 1bff58a..8f0b305 100644
--- a/meld/vc/svn.py
+++ b/meld/vc/svn.py
@@ -65,7 +65,7 @@ class Vc(_vc.CachedVc):
     def resolved_command(self):
         return [self.CMD,"resolved"]
     def valid_repo(self):
-        if _vc.call([self.CMD, "info"]):
+        if _vc.call([self.CMD, "info"], cwd=self.root):
             return False
         else:
             return True
diff --git a/meld/vc/tla.py b/meld/vc/tla.py
index 82744a0..d3c01d7 100644
--- a/meld/vc/tla.py
+++ b/meld/vc/tla.py
@@ -86,7 +86,7 @@ class Vc(_vc.CachedVc):
         return [self.CMD, "undo", "--"]
 
     def valid_repo(self):
-        if _vc.call([self.CMD, "tree-version"]):
+        if _vc.call([self.CMD, "tree-version"], cwd=self.root):
             return False
         else:
             return True



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