fromupstream: Support --replace for gitfetch commands

If the user wants to replace a CL with something from upstream while
using the git://url#branch/hash or https://url#branch/hash syntax it
will fail because we don't rewind HEAD to HEAD~. Add the replace code
that we use everywhere else.

BUG=None
TEST=fromupstream.py --replace git://git.kernel.org/torvalds#master/hash

Change-Id: I1c7bde18b636b07900e43576bebda5b4079e6d18
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2020909
Commit-Queue: Stephen Boyd <swboyd@chromium.org>
Commit-Queue: Douglas Anderson <dianders@chromium.org>
Tested-by: Stephen Boyd <swboyd@chromium.org>
Auto-Submit: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
1 file changed