[PATCH] ui: refactor and introduce editfile

Mads Kiilerich mads at kiilerich.com
Mon Aug 30 07:21:42 CDT 2010


On 08/28/2010 04:39 PM, Brodie Rao wrote:
> What if I want to call ui.editfile() even though there's no configured
> username? What should I pass?

Existing uses of ui.edit just passes ui.username() as default.

> Also, it'd be nice if it were documented that HGUSER is available to the
> editor. I see at one point long ago it was used in hgeditor when
> invoking gpg, but it no longer uses it.

I have never understood why it is there. Do you see any usecases?

(A forensic analysis shows that it got started by 
http://osdir.com/ml/version-control.mercurial.devel/2005-07/msg00466.html / 
http://mercurial.selenic.com/hg/hg/rev/b55a78595ef6 to combine 
http://mercurial.selenic.com/hg/hg/rev/9a2075c0b9b8#l1.22 with 
http://mercurial.selenic.com/hg/hg/rev/d2994b5298fb )

Removing the last traces of HGUSER will remove some "non-obvious" code 
and clean up some strange dependencies. Considering that it is 
undocumented and probably unused I think it could have been removed 5 
years ago with http://mercurial.selenic.com/hg/hg/rev/f93fde8f5027 . I 
still think it would be a good idea, but it will probably require 
approval from the committee for backward compatibility.

/Mads


More information about the Mercurial-devel mailing list