Richard Lowe wrote:
> Nathan Bush <nathan.bush at sun.com> writes:
> 
>> Rich (since we discussed this one already) or anyone else, please review:
>>
>> 448 webrev should use Hg's ui.username property to identify preparer
>> http://cr.opensolaris.org/~nbush/scm-migration/448/webrev/
> 
> Perhaps it would be better to use html_quote on the result, rather
> than duplicating 2/3rds of it? (< and >, but not &).

Yes.  I didn't even notice that was there.  I made this change to use it:

2457,2458c2457
<               preparer="$(echo "$preparer" | \
<                   sed -e 's/</\&lt;/g' -e 's/>/\&gt;/g')"
---
 >               preparer="$(echo "$preparer" | html_quote)"

> 
> Beyond that, it looks ok to me.
> 
>>From what I can tell, the behaviour of showconfig in this case would
> be correct, it will use the settings as found in order, ignoring
> untrusted hgrc files, so the setting in the workspace would be used
> first as long as you trust that hgrc.
> 
> (that's partly a note to myself, since I was somewhat wondering about
> that).

It looks like if you run showconfig in an untrusted repo, it works as you
explained, but you will get some messages to stderr about the untrusted
files.  These would appear on the webrev stderr output.  So, I think it
is good to make this change also:

2455c2455
<       preparer=`hg showconfig ui.username`
---
 >       preparer=`hg showconfig ui.username 2>/dev/null`

I also found a way to try and ignore all per-repo hgrc files by using:

hg --cwd ~ showconfig ui.username

But this doesn't seem to be so useful after all.  I think it will be
rare to specify ui.username outside of $HOME/.hgrc, but someone may
want to set it in a per-repo hgrc if they work in multiple communities
and present different identities to each.  We shouldn't prevent that.

Thanks,

--Nathan


Reply via email to