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