Commit f4b11cb7 authored by Kai Willadsen's avatar Kai Willadsen

vc: Make the working directory always be whatever we're given

This should be a no-op in all cases, and is the only sane thing
to do anyway.
parent d7d92b51
......@@ -202,9 +202,6 @@ class Vc(object):
"""
raise NotImplementedError()
def get_working_directory(self, workdir):
return workdir
def refresh_vc_state(self, path=None):
"""Update cached version control state
......
......@@ -130,9 +130,6 @@ class Vc(_vc.Vc):
def valid_repo(cls, path):
return not _vc.call([cls.CMD, "root"], cwd=path)
def get_working_directory(self, workdir):
return self.root
def get_files_to_commit(self, paths):
files = []
for p in paths:
......
......@@ -238,12 +238,6 @@ class Vc(_vc.Vc):
# appears to be correct under the default git bash shell however.
return not _vc.call([cls.CMD, "branch"], cwd=path)
def get_working_directory(self, workdir):
if workdir.startswith("/"):
return self.root
else:
return ''
def _get_modified_files(self, path):
# Update the index to avoid reading stale status information
proc = self.run("update-index", "--refresh")
......
......@@ -71,12 +71,6 @@ class Vc(_vc.Vc):
def valid_repo(cls, path):
return not _vc.call([cls.CMD, "root"], cwd=path)
def get_working_directory(self, workdir):
if workdir.startswith("/"):
return self.root
else:
return ''
def get_path_for_repo_file(self, path, commit=None):
if commit is not None:
raise NotImplementedError()
......
......@@ -578,13 +578,13 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
if len(pbase) and p.startswith(pbase):
kill = len(pbase) + 1
return p[kill:] or "."
workdir = self.vc.get_working_directory(working_dir)
files = [relpath(workdir, f) for f in files]
files = [relpath(working_dir, f) for f in files]
r = None
msg = shelljoin(command + files) + " (in %s)\n" % workdir
msg = shelljoin(command + files) + " (in %s)\n" % working_dir
self.consolestream.command(msg)
readiter = misc.read_pipe_iter(command + files, self.consolestream,
workdir=workdir)
workdir=working_dir)
try:
while r is None:
r = next(readiter)
......@@ -601,8 +601,8 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self.console_vbox.show()
if refresh:
self.refresh_partial(workdir)
yield workdir, r
self.refresh_partial(working_dir)
yield working_dir, r
def has_command(self, command):
vc_command = self.command_map.get(command)
......
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