Commit 7c5f4706 authored by Vincent Legoll's avatar Vincent Legoll

Revert r1209, r1210, r1211, as they broke VC plugins

when diffing files not at repository root.

svn path=/trunk/; revision=1267
parent c17118c6
......@@ -100,6 +100,9 @@ class Vc(object):
start = tmp
raise ValueError()
def get_working_directory(self, workdir):
return workdir
def cache_inventory(self, topdir):
pass
......
......@@ -50,6 +50,8 @@ class Vc(_vc.Vc):
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)
......
......@@ -71,6 +71,9 @@ class Vc(_vc.Vc):
# 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()
......
......@@ -62,6 +62,11 @@ class Vc(_vc.Vc):
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()
......
......@@ -45,6 +45,8 @@ class Vc(_vc.Vc):
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):
......
......@@ -65,6 +65,8 @@ class Vc(_vc.Vc):
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()
......
......@@ -89,6 +89,9 @@ class Vc(_vc.Vc):
# 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()
......
......@@ -369,9 +369,9 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment