[PATCH] tag: warn users about tag/branch possible name conflicts

Sune Foldager cryo at cyanite.org
Mon Apr 19 04:44:43 CDT 2010


On 19-04-2010 10:51, Nicolas Dumazet wrote:
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -164,9 +164,13 @@
>               if c in allchars:
>                   raise util.Abort(_('%r cannot be used in a tag name') % c)
>
> +        branches = self.branchtags()

self.branchmap() is quicker, as it just returns the internal dictionary 
without filtering for closed heads, reversing direction etc., which you 
don't need here.


>           for name in names:
>               self.hook('pretag', throw=True, node=hex(node), tag=name,
>                         local=local)
> +            if name in branches:
> +                self.ui.warn(_("warning: tag %s can conflict with existing"
> +                " branch name\n") % name)

...but the tag is still created, right? Should it require --force or 
something? And similar for hg branch, should it warn/require --force as 
well?

/Sune


More information about the Mercurial-devel mailing list