Patchwork [2,of,7] patch: add a new function to initialize diffopts by feature

mail settings
Submitter Siddharth Agarwal
Date Nov. 22, 2014, 1 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/6824/
State Superseded
Commit 3821be85fd4d73fe399e0eb306f9b701a70f069a
Headers show


Siddharth Agarwal - Nov. 22, 2014, 1 a.m.
# HG changeset patch
# User Siddharth Agarwal <>
# Date 1416358402 28800
#      Tue Nov 18 16:53:22 2014 -0800
# Node ID 4c271ab8d6fe2786584540fbaf50317b8f7c4447
# Parent  cefd057e041cf287634002945472a0501900c66e
patch: add a new function to initialize diffopts by feature

Not all callers are interested in all diffopts -- for example, commands like
record (which use diff internally) break when diffopts like noprefix are
enabled. This function will allow us to add flags that callers can use to
enable only the features they're interested in.


diff --git mercurial/ mercurial/
--- mercurial/
+++ mercurial/
@@ -1559,6 +1559,9 @@ 
 def diffopts(ui, opts=None, untrusted=False, section='diff'):
+    return difffeatureopts(ui, opts=opts, untrusted=untrusted, section=section)
+def difffeatureopts(ui, opts=None, untrusted=False, section='diff'):
     def get(key, name=None, getter=ui.configbool, forceplain=None):
         if opts:
             v = opts.get(key)