[patch] convert: gnu arch source for convert extension

Bryan O'Sullivan bos at serpentine.com
Mon Feb 4 12:49:14 CST 2008


Aleix Conchillo Flaqué wrote:

> I recently sent an email with a GNU Arch source for the convert
> extension.

A few smallish comments and questions:

> diff -N -r -u crew.orig/hgext/convert/common.py crew/hgext/convert/common.py
> --- crew.orig/hgext/convert/common.py	2008-02-03 16:47:03.000000000 +0100
> +++ crew/hgext/convert/common.py	2008-02-03 17:19:56.000000000 +0100
> @@ -227,7 +227,7 @@
>              except TypeError:
>                  pass
>          cmdline = [util.shellquote(arg) for arg in cmdline]
> -        cmdline += ['<', util.nulldev]
> +        cmdline += ['2>', util.nulldev, '<', util.nulldev]
>          cmdline = ' '.join(cmdline)
>          self.ui.debug(cmdline, '\n')
>          return cmdline

Patrick (or some other Windows person), will this cause problems on Windows?

> +        if util.find_exe('tla'):
> +            self.execmd = 'tla'
> +        else:
> +            if util.find_exe('baz'):
> +                self.execmd = 'baz'
> +            else:
> +                raise util.Abort(_('cannot find a GNU Arch tool'))

Use "elif" to avoid the nesting here.

> +        self.changes[rev] = {}
> +        self.changes[rev]['summary'] = ''
> +        self.changes[rev]['date'] = ''
> +        self.changes[rev]['author'] = ''
> +        self.changes[rev]['add_files'] = []
> +        self.changes[rev]['mod_files'] = []
> +        self.changes[rev]['del_files'] = []
> +        self.changes[rev]['ren_files'] = {}
> +        self.changes[rev]['ren_dirs'] = {}

Why not just put these into a small class, instead of keys on a dict?

Thanks,

	<b


More information about the Mercurial-devel mailing list