[PATCH] Re: 2 bugs in tag removal
Matt Mackall
mpm at selenic.com
Sun Dec 9 07:00:56 UTC 2007
On Sun, Dec 09, 2007 at 03:50:31PM +0900, Osku Salerma wrote:
> On Sun, 9 Dec 2007, Matt Mackall wrote:
>
> >On Sun, Dec 09, 2007 at 10:24:31AM +0900, Osku Salerma wrote:
>
> >>+ found = ((opts['local'] and tagtype == 'local') or
> >>+ (not opts['local'] and tagtype == 'global'))
> >>+
> >>+ if not found:
> >>+ raise util.Abort(_('%s tag %s does not exist')
> >>+ % (opts['local'] and 'local' or 'global',
> >>name))
> >
> >How about:
> >
> >if opts['local'] and tagtype == 'global':
> > raise util.Abort(_('%s tag is global) % name)
> >if not opts['local'] and tagtype == 'local':
> > raise util.Abort(_('%s tag is local) % name)
> >
> >..which is a better message and less code.
>
> That doesn't handle the case where the tag doesn't exist at all. You'd
> need to add a third case for that, at which point it's not really any less
> code. Do you still want me to implement it that way?
Well I do like having the better error message, yes.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list