This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit 09ac9841 authored by Steve Borho's avatar Steve Borho
Browse files

fileview: give folder depth to diff paths

Mercurial expects diffs to have a 'strip' level of 1, so we need to provide a
directory level that can be stripped.  Without this hack, Mercurial's patch
routines will not apply the unified diffs we generate.
parent b18285ae5a92
......@@ -698,7 +698,7 @@ class FileData(object):
self.olddata = olddata
olddata = olddata.splitlines()
newdata = newdata.splitlines()
gen = difflib.unified_diff(olddata, newdata, oldname, wfile,
gen = difflib.unified_diff(olddata, newdata, 'a/'+oldname, 'b/'+wfile,
data = []
if repo.ui.config('diff', 'showfunc'):
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