meld r1267 - in trunk: . vc



Author: vincele
Date: Tue Mar 17 23:00:56 2009
New Revision: 1267
URL: http://svn.gnome.org/viewvc/meld?rev=1267&view=rev

Log:
Revert r1209, r1210, r1211, as they broke VC plugins
when diffing files not at repository root.


Modified:
   trunk/vc/_vc.py
   trunk/vc/bzr.py
   trunk/vc/darcs.py
   trunk/vc/git.py
   trunk/vc/mercurial.py
   trunk/vc/monotone.py
   trunk/vc/tla.py
   trunk/vcview.py

Modified: trunk/vc/_vc.py
==============================================================================
--- trunk/vc/_vc.py	(original)
+++ trunk/vc/_vc.py	Tue Mar 17 23:00:56 2009
@@ -100,6 +100,9 @@
             start = tmp
         raise ValueError()
 
+    def get_working_directory(self, workdir):
+        return workdir
+
     def cache_inventory(self, topdir):
         pass
 

Modified: trunk/vc/bzr.py
==============================================================================
--- trunk/vc/bzr.py	(original)
+++ trunk/vc/bzr.py	Tue Mar 17 23:00:56 2009
@@ -50,6 +50,8 @@
         return [self.CMD,"rm"]
     def revert_command(self):
         return [self.CMD,"revert"]
+    def get_working_directory(self, workdir):
+        return self.root
 
     def cache_inventory(self, rootdir):
         self._tree_cache = self.lookup_tree(rootdir)

Modified: trunk/vc/darcs.py
==============================================================================
--- trunk/vc/darcs.py	(original)
+++ trunk/vc/darcs.py	Tue Mar 17 23:00:56 2009
@@ -71,6 +71,9 @@
         # will not work, since darcs needs interaction it seems
         return [self.CMD, "revert", "-a"]
 
+    def get_working_directory(self, workdir):
+        return self.root
+ 
     def cache_inventory(self, rootdir):
         self._cached_statuses = self._calculate_statuses()
 

Modified: trunk/vc/git.py
==============================================================================
--- trunk/vc/git.py	(original)
+++ trunk/vc/git.py	Tue Mar 17 23:00:56 2009
@@ -62,6 +62,11 @@
         return [self.CMD,"rm"]
     def revert_command(self):
         return [self.CMD,"checkout"]
+    def get_working_directory(self, workdir):
+        if workdir.startswith("/"):
+            return self.root
+        else:
+            return ''
 
     def cache_inventory(self, topdir):
         self._tree_cache = self.lookup_tree()

Modified: trunk/vc/mercurial.py
==============================================================================
--- trunk/vc/mercurial.py	(original)
+++ trunk/vc/mercurial.py	Tue Mar 17 23:00:56 2009
@@ -45,6 +45,8 @@
         return [self.CMD,"rm"]
     def revert_command(self):
         return [self.CMD,"revert"]
+    def get_working_directory(self, workdir):
+        return self.root
 
     def _get_dirsandfiles(self, directory, dirs, files):
 

Modified: trunk/vc/monotone.py
==============================================================================
--- trunk/vc/monotone.py	(original)
+++ trunk/vc/monotone.py	Tue Mar 17 23:00:56 2009
@@ -65,6 +65,8 @@
         return [self.CMD,"drop"]
     def revert_command(self):
         return [self.CMD,"revert"]
+    def get_working_directory(self, workdir):
+        return self.root
 
     def cache_inventory(self, rootdir):
         self._tree_cache = self.lookup_tree()

Modified: trunk/vc/tla.py
==============================================================================
--- trunk/vc/tla.py	(original)
+++ trunk/vc/tla.py	Tue Mar 17 23:00:56 2009
@@ -89,6 +89,9 @@
         # Will only work on later versions of tla
         return [self.CMD, "undo", "--"]
 
+    def get_working_directory(self, workdir):
+        return self.root
+ 
     def cache_inventory(self, rootdir):
         self._cached_statuses = self._calculate_statuses()
 

Modified: trunk/vcview.py
==============================================================================
--- trunk/vcview.py	(original)
+++ trunk/vcview.py	Tue Mar 17 23:00:56 2009
@@ -369,9 +369,9 @@
             kill = len(pbase) and (len(pbase)+1) or 0
             return p[kill:] or "."
         if len(files) == 1 and os.path.isdir(files[0]):
-            workdir = files[0]
+            workdir = self.vc.get_working_directory(files[0])
         else:
-            workdir =  _commonprefix(files)
+            workdir = self.vc.get_working_directory( _commonprefix(files) )
         files = [ relpath(workdir, f) for f in files ]
         r = None
         self.consolestream.write( misc.shelljoin(command+files) + " (in %s)\n" % workdir)



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