[fuchsia_roller] Perform second update from local manifest

This change performs the second jiri update (the one needed to ensure
the source manifest is correct) using the local manifest, rather than
the remote. This ensures that as long as the manifest imported and
updated from are the same, then the source manifest that's created will
include the pin updated by the roller.

IN-249

Change-Id: I847afa2acbde871ee5b11259b7f29d11be1e37e3
diff --git a/recipes/fuchsia_roller.expected/cobalt_project.json b/recipes/fuchsia_roller.expected/cobalt_project.json
index 9d7f06c..0921a64 100644
--- a/recipes/fuchsia_roller.expected/cobalt_project.json
+++ b/recipes/fuchsia_roller.expected/cobalt_project.json
@@ -170,6 +170,7 @@
       "-time",
       "-autoupdate=false",
       "-attempts=3",
+      "-local-manifest=true",
       "-run-hooks=false"
     ],
     "cwd": "[START_DIR]/garnet",
diff --git a/recipes/fuchsia_roller.expected/garnet.json b/recipes/fuchsia_roller.expected/garnet.json
index 60f1a8d..6b91e37 100644
--- a/recipes/fuchsia_roller.expected/garnet.json
+++ b/recipes/fuchsia_roller.expected/garnet.json
@@ -169,6 +169,7 @@
       "-time",
       "-autoupdate=false",
       "-attempts=3",
+      "-local-manifest=true",
       "-run-hooks=false"
     ],
     "cwd": "[START_DIR]/peridot",
diff --git a/recipes/fuchsia_roller.expected/missing_revision.json b/recipes/fuchsia_roller.expected/missing_revision.json
index 65335b2..2b016be 100644
--- a/recipes/fuchsia_roller.expected/missing_revision.json
+++ b/recipes/fuchsia_roller.expected/missing_revision.json
@@ -188,6 +188,7 @@
       "-time",
       "-autoupdate=false",
       "-attempts=3",
+      "-local-manifest=true",
       "-run-hooks=false"
     ],
     "cwd": "[START_DIR]/garnet",
diff --git a/recipes/fuchsia_roller.expected/peridot.json b/recipes/fuchsia_roller.expected/peridot.json
index 23907b1..25e3424 100644
--- a/recipes/fuchsia_roller.expected/peridot.json
+++ b/recipes/fuchsia_roller.expected/peridot.json
@@ -169,6 +169,7 @@
       "-time",
       "-autoupdate=false",
       "-attempts=3",
+      "-local-manifest=true",
       "-run-hooks=false"
     ],
     "cwd": "[START_DIR]/topaz",
diff --git a/recipes/fuchsia_roller.expected/zircon.json b/recipes/fuchsia_roller.expected/zircon.json
index c271027..82d5b9e 100644
--- a/recipes/fuchsia_roller.expected/zircon.json
+++ b/recipes/fuchsia_roller.expected/zircon.json
@@ -169,6 +169,7 @@
       "-time",
       "-autoupdate=false",
       "-attempts=3",
+      "-local-manifest=true",
       "-run-hooks=false"
     ],
     "cwd": "[START_DIR]/garnet",
diff --git a/recipes/fuchsia_roller.expected/zircon_dry_run.json b/recipes/fuchsia_roller.expected/zircon_dry_run.json
index 1abf718..5fe10ec 100644
--- a/recipes/fuchsia_roller.expected/zircon_dry_run.json
+++ b/recipes/fuchsia_roller.expected/zircon_dry_run.json
@@ -169,6 +169,7 @@
       "-time",
       "-autoupdate=false",
       "-attempts=3",
+      "-local-manifest=true",
       "-run-hooks=false"
     ],
     "cwd": "[START_DIR]/garnet",
diff --git a/recipes/fuchsia_roller.py b/recipes/fuchsia_roller.py
index fdaa9ad..1c929b9 100644
--- a/recipes/fuchsia_roller.py
+++ b/recipes/fuchsia_roller.py
@@ -117,8 +117,16 @@
       # After rolling the commit, re-update and emit a source manifest.
       # Emitting a source manifest is necessary for luci-notify to be able to
       # pick up on a checkout diff, allowing it to notify the blamelist across
-      # the whole checkout.
-      api.jiri.update(run_hooks=False)
+      # the whole checkout. Note that we need to say "local_manifest=True"
+      # because otherwise jiri won't use the pin we just updated in the jiri
+      # update, so the emitted source manifest won't contain the updated pin.
+      #
+      # Note that local_manifest=True only works in this way if the pin we're
+      # updating is for the same manifest that we originally pulled from (i.e.
+      # the manifest property) since otherwise the manifest update  will just
+      # get ignored and jiri will error (it will never overwrite a dirty
+      # repository).
+      api.jiri.update(run_hooks=False, local_manifest=True)
       api.jiri.emit_source_manifest()
 
       # Get the commit history and generate a commit message.