fromupstream: Fix source_line/tag/changeline with multiple locations

If we launch the script with multiple locations, the source_line
("cherry picked from commit XXX") of all the  patches show HASH from
the first commit.

This is because the _match_*() functions overwrite the content of the
arg dict, which is used by the next locations.

Lets restore the user provided arguments before the process of every
location.

BUG=none
TEST=fromupstream.py -b=b:1234 -t="None" upstream://7945f929f1a77a1c8887a97ca07f87626858ff42 upstream://65048f4dd9fae7335b48ab23a879119c0e7fa10

Change-Id: I7c498ac62cfde1339ddc50257f97067451ae1f18
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2517019
Reviewed-by: Tzung-Bi Shih <tzungbi@chromium.org>
Tested-by: Ricardo Ribalda <ribalda@chromium.org>
Commit-Queue: Ricardo Ribalda <ribalda@chromium.org>
diff --git a/contrib/fromupstream.py b/contrib/fromupstream.py
index a6dafd6..55f858d 100755
--- a/contrib/fromupstream.py
+++ b/contrib/fromupstream.py
@@ -521,7 +521,17 @@
         (re.compile(r'^(https://.+)/commit/\?h=(.+)\&id=([0-9a-f]+)$'), _match_gitweb),
     )
 
+    # Backup user provided parameters
+    user_source_line = args['source_line']
+    user_tag = args['tag']
+    user_changeid = args['changeid']
+
     for location in args['locations']:
+        # Restore user parameters
+        args['source_line'] = user_source_line
+        args['tag'] = user_tag
+        args['changeid'] = user_changeid
+
         if args['debug']:
             print('location=%s' % location)