[PATCH 3 of 4] convert: Clean up authormap key=value splitting

Marti Raudsepp marti at juffo.org
Thu Feb 28 09:46:36 CST 2008


# HG changeset patch
# User Marti Raudsepp <marti at juffo.org>
# Date 1204213076 -7200
# Node ID f83a6b6c9b6f664a1f67374698f52e07c3cf9a3f
# Parent  fe6aef431a01450e9bfab704986bbfb7a7fe40a6
convert: Clean up authormap key=value splitting.

Introduces a subtle parsing difference: dstauthor can now contain '='
characters.

diff -r fe6aef431a01 -r f83a6b6c9b6f hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py	Thu Feb 28 17:37:56 2008 +0200
+++ b/hgext/convert/convcmd.py	Thu Feb 28 17:37:56 2008 +0200
@@ -194,8 +194,9 @@ class converter(object):
             if line.strip() == '':
                 continue
             try:
-                srcauthor = line.split('=')[0].strip()
-                dstauthor = line.split('=')[1].strip()
+                srcauthor, dstauthor = line.split('=', 1)
+                srcauthor = srcauthor.strip()
+                dstauthor = dstauthor.strip()
                 if srcauthor in self.authors and dstauthor != self.authors[srcauthor]:
                     self.ui.status(
                         'Overriding mapping for author %s, was %s, will be %s\n'


More information about the Mercurial-devel mailing list