summaryrefslogtreecommitdiff
path: root/hg-fast-export/plugins/fudge_user_ids/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'hg-fast-export/plugins/fudge_user_ids/__init__.py')
-rw-r--r--hg-fast-export/plugins/fudge_user_ids/__init__.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/hg-fast-export/plugins/fudge_user_ids/__init__.py b/hg-fast-export/plugins/fudge_user_ids/__init__.py
index 9e81195..0e243b5 100644
--- a/hg-fast-export/plugins/fudge_user_ids/__init__.py
+++ b/hg-fast-export/plugins/fudge_user_ids/__init__.py
@@ -13,16 +13,16 @@ def build_filter(args):
class Filter:
# What git considers valid (see parse_ident() in fast-import.c)
- _valid_id_re = re.compile(rb'^[^<>]* <[^<>]+>$')
+ _valid_id_re = re.compile(rb"^[^<>]* <[^<>]+>$")
# Special characters we may need to replace
- _id_special_re = re.compile(rb'[<>]')
+ _id_special_re = re.compile(rb"[<>]")
def __init__(self, args):
pass
def commit_message_filter(self, commit_data):
- for key in ['author', 'committer']:
+ for key in ["author", "committer"]:
try:
user_id = commit_data[key]
except KeyError:
@@ -35,13 +35,16 @@ class Filter:
email = templatefilters.email(user_id)
# Replace any special characters left in the name and email
- name = self._id_special_re.sub(b'?', name)
- email = self._id_special_re.sub(b'?', email)
+ name = self._id_special_re.sub(b"?", name)
+ email = self._id_special_re.sub(b"?", email)
- commit_data[key] = b'%s <%s>' % (name, email)
+ commit_data[key] = b"%s <%s>" % (name, email)
sys.stderr.write(
'Replaced %s id "%s" with "%s"\n'
- % (key,
- user_id.decode('utf-8', errors='replace'),
- commit_data[key].decode('utf-8', errors='replace')))
+ % (
+ key,
+ user_id.decode("utf-8", errors="replace"),
+ commit_data[key].decode("utf-8", errors="replace"),
+ )
+ )