extract: move 'branch' assignment where it is parsed
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 06 Oct 2015 02:06:36 -0700
changeset 26551 5b8faea8b509
parent 26550 72782f60dbc9
child 26552 4caf143313a8
extract: move 'branch' assignment where it is parsed There is one setter and no consumer, we can move it there directly.
mercurial/patch.py
--- a/mercurial/patch.py	Tue Oct 06 02:05:56 2015 -0700
+++ b/mercurial/patch.py	Tue Oct 06 02:06:36 2015 -0700
@@ -190,7 +190,6 @@
         # should try to parse msg['Date']
         date = None
         nodeid = None
-        branch = None
         parents = []
 
         if subject:
@@ -236,7 +235,7 @@
                         elif line.startswith("# Date "):
                             date = line[7:]
                         elif line.startswith("# Branch "):
-                            branch = line[9:]
+                            data['branch'] = line[9:]
                         elif line.startswith("# Node ID "):
                             nodeid = line[10:]
                         elif line.startswith("# Parent "):
@@ -268,7 +267,6 @@
         os.unlink(tmpname)
         data['user'] = user
         data['date'] = date
-        data['branch'] = branch
         return data
 
     if parents:
@@ -279,7 +277,6 @@
     data['filename'] = tmpname
     data['user'] = user
     data['date'] = date
-    data['branch'] = branch
     data['nodeid'] = nodeid
     return data