diff mercurial/hgweb/webcommands.py @ 31727:6be6e4becaaf

hgweb: prefix line id by ctx shortnode in filelog when patches are shown When "patch" query parameter is present in requests to filelog view, line ids in patches diff are no longer unique in the page since several patches are shown on the same page. We now prefix line id by changeset shortnode when several patches are displayed in the same page to have unique line ids overall.
author Denis Laxalde <denis@laxalde.org>
date Thu, 30 Mar 2017 21:40:10 +0200
parents e540846c67e0
children 604d31507f86
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Wed Mar 29 12:14:20 2017 -0700
+++ b/mercurial/hgweb/webcommands.py	Thu Mar 30 21:40:10 2017 +0200
@@ -998,7 +998,8 @@
         basectx = ctx.p1()
         path = fctx.path()
         return webutil.diffs(web, tmpl, ctx, basectx, [path], diffstyle,
-                             linerange=linerange)
+                             linerange=linerange,
+                             lineidprefix='%s-' % ctx.hex()[:12])
 
     linerange = None
     if lrange is not None: