1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-28 10:46:15 +01:00

Merge branch 'fix_nonexistent_variable' of https://github.com/dcermak/osc

Fix NameError in Package.mergefile. It got broken in commit
63c2aa3630 ("Do not run diff3 in the
shell"). The mergefile method itself needs some love because
opening the file with mode 'r' will break sooner or later (when it
was introduced, it was no problem because we lived in the old python2
world). Also, instead of the newly introduced args variable, we could
re-introduce the merge_cmd variable again.
This commit is contained in:
Marcus Huewe 2019-09-20 22:32:57 +02:00
commit 74e1f47574

View File

@ -1683,8 +1683,8 @@ class Package:
# diff3 OPTIONS... MINE OLDER YOURS
ret = -1
with open(filename, 'w') as f:
ret = run_external('diff3', '-m', '-E', myfilename,
storefilename, upfilename, stdout=f)
args = ('-m', '-E', myfilename, storefilename, upfilename)
ret = run_external('diff3', *args, stdout=f)
# "An exit status of 0 means `diff3' was successful, 1 means some
# conflicts were found, and 2 means trouble."
@ -1703,6 +1703,7 @@ class Package:
self.write_conflictlist()
return 'C'
else:
merge_cmd = 'diff3 ' + ' '.join(args)
raise oscerr.ExtRuntimeError('diff3 failed with exit code: %s' % ret, merge_cmd)
def update_local_filesmeta(self, revision=None):