[PATCH] splicemap: support for path with spaces in splicemap (issue3844)

Kevin Bullock kbullock+mercurial at ringworld.org
Fri May 3 12:02:26 CDT 2013


On 3 May 2013, at 10:42 AM, Szymon Wróblewski wrote:

>> Patch doesn't apply cleanly (appears to have some mailer-induced damage). Please consider using the patchbomb extension <http://mercurial.selenic.com/wiki/PatchbombExtension>.
> 
> I forgot to send mail in plain text mode in gmail. Sorry. I'll try to
> use Patchbomb extension next time.
> 
>> When re-sending, we also generally use the --flag option to mark a patch/series V2, V3, etc.
> 
> For the sake of discussion continuation I'll use reply for the last
> time. As I understand future patch versions should be sent as a new
> thread with [PATCH Vx] in topic, right?

You can pass --in-reply-to MESSAGE-ID with patchbomb. Doesn't much matter one way or the other.

> # HG changeset patch
> # User Szymon Wroblewski <bluex0 at gmail.com>
> # Date 1367547396 -7200
> # Node ID 084dfca47663a7f65c1c5eaa919545e95bbf99e4
> # Parent  4cdec37f0018e361e8159632ec5afeb705c433b1
> splicemap: support paths with spaces in splicemap (issue3844)
> 
> Shlex module was used to split line as suggested. Split operates in POSIX mode.
> 
> diff -r 4cdec37f0018 -r 084dfca47663 hgext/convert/convcmd.py
> --- a/hgext/convert/convcmd.py Sat Apr 27 23:49:34 2013 -0700
> +++ b/hgext/convert/convcmd.py Fri May 03 04:16:36 2013 +0200
> @@ -17,7 +17,7 @@
> from p4 import p4_source
> import filemap
> 
> -import os, shutil
> +import os, shutil, shlex
> from mercurial import hg, util, encoding
> from mercurial.i18n import _
> 
> @@ -142,26 +142,18 @@
>                 if not line:
>                     # Ignore blank lines
>                     continue
> -                try:
> -                    child, parents = line.split(' ', 1)
> -                    self.source.checkrevformat(child)
> -                    parents = parents.replace(',', ' ').split()
> -                    # check if number of parents are upto 2 max
> -                    if (len(parents) > 2):
> -                        raise util.Abort(_('syntax error in %s(%d): child '\
> -                                            'parent1[,parent2] expected') \
> -                                            % (path, i + 1))
> -                    for parent in parents:
> -                        self.source.checkrevformat(parent)
> -                except ValueError:
> -                    raise util.Abort(_('syntax error in %s(%d): child '\
> -                                        'parent1[,parent2] expected') \
> -                                        % (path, i + 1))
> -                pp = []
> -                for p in parents:
> -                    if p not in pp:
> -                        pp.append(p)
> -                m[child] = pp
> +                line = shlex.split(line.replace(',', ' '))

What about paths that have commas in them?

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list