Commit c300c6e6 authored by Kai Willadsen's avatar Kai Willadsen

Correctly start merge mode with output file for non-auto merges

parent f3d4f96f
......@@ -936,8 +936,10 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
def set_merge_output_file(self, filename):
if len(self.textbuffer) < 2:
return
self.textbuffer[1].data.savefile = os.path.abspath(filename)
self.textbuffer[1].data.set_label(filename)
buf = self.textbuffer[1]
buf.data.savefile = os.path.abspath(filename)
buf.data.set_label(filename)
self.set_buffer_writable(buf, os.access(buf.data.savefile, os.W_OK))
self.fileentry[1].set_filename(os.path.abspath(filename))
self.recompute_label()
......@@ -1061,7 +1063,10 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
nextbit = nextbit[0:-1]
t.buf.insert(t.buf.get_end_iter(), nextbit)
else:
writable = os.access(t.filename, os.W_OK)
if t.buf.data.savefile:
writable = os.access(t.buf.data.savefile, os.W_OK)
else:
writable = os.access(t.filename, os.W_OK)
self.set_buffer_writable(t.buf, writable)
t.buf.data.encoding = t.codec[0]
if hasattr(t.file, "newlines"):
......
......@@ -622,11 +622,13 @@ class MeldWindow(gnomeglade.Component):
doc.on_button_diff_clicked(None)
return doc
def append_filediff(self, files):
def append_filediff(self, files, merge_output=None):
assert len(files) in (1, 2, 3)
doc = filediff.FileDiff(app.prefs, len(files))
self._append_page(doc, "text-x-generic")
doc.set_files(files)
if merge_output is not None:
doc.set_merge_output_file(merge_output)
return doc
def append_filemerge(self, files, merge_output=None):
......@@ -666,7 +668,7 @@ class MeldWindow(gnomeglade.Component):
elif auto_merge:
return self.append_filemerge(paths, merge_output=merge_output)
else:
return self.append_filediff(paths)
return self.append_filediff(paths, merge_output=merge_output)
def append_vcview(self, location, auto_compare=False):
doc = vcview.VcView(app.prefs)
......
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