# HG changeset patch # User Pierre-Yves David # Date 2015-10-06 09:22:23 # Node ID dbd4392daedf542efd2419270b8374eb01eb06eb # Parent fe52cd049f0182fa466914545e1c2f640cc13da1 extract: parse 'branch' using the generic mechanism Parsing 'branch' is very simple and a good first test. diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -153,7 +153,9 @@ def split(stream): ## Some facility for extensible patch parsing: # list of pairs ("header to match", "data key") -patchheadermap = [('Date', 'date')] +patchheadermap = [('Date', 'date'), + ('Branch', 'branch'), + ] def extract(ui, fileobj): '''extract patch from data read from fileobj. @@ -234,8 +236,6 @@ def extract(ui, fileobj): if line.startswith('# User '): data['user'] = line[7:] ui.debug('From: %s\n' % data['user']) - elif line.startswith("# Branch "): - data['branch'] = line[9:] elif line.startswith("# Node ID "): data['nodeid'] = line[10:] elif line.startswith("# Parent "):