Diff ignoring whitespace for some commands

Shane Turner shane.turner at newpace.ca
Tue Jan 10 14:47:39 UTC 2012


On 10/01/2012 10:08 AM, Ben Schmidt wrote:
> Hi,
>
> I added
>
>    [diff]
>    ignorews=yes
>
> to my hgrc because I want the output of hg diff and the display via
> hgweb.cgi and hg serve to ignore whitespace.
>
> However, it's also affecting Mq: patches are being created/refreshed
> also ignoring whitespace, so when they are applied they don't accurately
> represent my changes or restore the tree to exactly the same state as
> when the patch was created/refreshed.
>
> I want to ignore whitespace for viewing, to facilitate code review, but
> not for creating Mq patches (or changesets of anything else).
>
> How can I achieve this?
>
> I know I can give -b as a default parameter for hg diff without
> affecting other things, but is there a way I can specifically target hg
> serve and hgweb with a diff option? Or can I somehow exclude the option
> for Mq commands or something?
>
> I couldn't find an answer on the web, so am turning to the experts on
> the mailing list. Hope someone can help.
>
> Smiles,
>
> Ben.
>
 From reading the hgweb.cgi file, it appears that you can point it at a 
custom config file by setting the "config" variable.

In http://www.selenic.com/repo/hg-stable/file/tip/hgweb.cgi it's line 7.

I would guess you could have the custom config with diff.ignorews=yes 
and your normal hgrc without it set.

For what it's worth, I haven't tested this myself.

Shane
-- 
	
	
	
	Shane Turner

	Senior Software Developer
phone 	+1 (902) 406--8375  x1008
email 	Shane.Turner at NewPace.ca <mailto:Shane.Turner at newpace.ca>
aim <aim:GoIm?screenname=Shane.Turner at newpace.ca>/msn 
<msnim:chat?contact=Shane.Turner at newpace.ca> 	Shane.Turner at NewPace.ca 
<aim:GoIm?screenname=Shane.Turner at newpace.ca>
skype 	saturnjct <skype:saturnjct>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20120110/9ec05458/attachment-0002.html>


More information about the Mercurial mailing list