[PATCH 2 of 5] commands: delay checknewlabel until after aborts

Yuya Nishihara yuya at tcha.org
Fri Jan 15 07:27:58 CST 2016


On Thu, 14 Jan 2016 13:32:48 -0500, timeless wrote:
> > It doesn't make sense to me that checkformat() is still applied to known
> > bookmarks. Do we want to trust known bookmarks or don't we?
> 
> with my change, checkformat is really just "strip trailing whitespace
> and ensure there's something left". I've renamed it.
> 
> > This fixes https://bz.mercurial-scm.org/show_bug.cgi?id=5016 .
> > Can you add a test?
> 
> It took a bit to get it to work (I shake my first at both hg export
> and hg import), but yes.
> 
> > That said, I'm afraid of delaying checknewlabel() because we would have to be
> > more careful to not make new labels bypass the validation.

Given that checknewlabel() receives repo, it would be designed to eventually
do more specific things. And we have namespace API now. So perhaps, we can
make checknewlabel() allow existing badly-named label.


More information about the Mercurial-devel mailing list