Ran "2to3 -w -n -f print ./" and manually added imports.
Ran "^\s*print " and "\s+print " to find batch/shell scripts, comments and the like with embedded code, and updated them manually.
Also manually added imports to files, which used print as a function, but were missing the import.
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: Id777e4d4df4adcdfdab1b18bde89f235ef491b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595684
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
Add a shortcut to extend the branches to be rebased with the current
branch without having to type its name.
Change-Id: If2fa117a6418590cdec5e65430f65dcdc825b611
Reviewed-on: https://chromium-review.googlesource.com/c/1483030
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
When calling `git rebase-update <branches>`, don't emit messages about
skipping branches which are not in the list of branches to be rebased.
R=iannucci@chromium.org
Change-Id: Ia5135d2e794646aaec68bca1aa64f4a73c98c186
Reviewed-on: https://chromium-review.googlesource.com/c/1476394
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
This change inserts a flush after "..." in lines like:
Failed! Attempting to squash mybranch ... Failed!
and:
Failed! Attempting to squash mybranch ... Success!
This way the user can follow the progress better and has an indication
of why the rebase is taking longer than they might expect.
Bug:
Change-Id: Ie04db2879fccd363d7b0f13b7a5217f1c13fd0e2
Reviewed-on: https://chromium-review.googlesource.com/737009
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Andrew Moylan <amoylan@chromium.org>
Through a comedy of wrapper scripts, the ^ is being swallowed, which
causes the `git config` invocation to match all lines which HAVE
"remote" in them, instead of matching lines which BEGIN with remote.
R=maruel@chromium.org, pkasting@chromium.org
BUG=
Review URL: https://codereview.chromium.org/1566343002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298185 0039d316-1c4b-4281-b951-d872f2087c98
This changes the 'empty' branch detection to compare the commit trees instead
of the commit hashes. This avoids empty-branch detection when you have multiple
renames on the branch that end up canceling eachother out. Previously you'd
end up with the rename-commits, in order, in your rebased branch, even though
when you run `git upstream-diff` you get nothing.
R=agable@chromium.org, jochen@chromium.org, vadimsh@chromium.org
BUG=438208
Review URL: https://codereview.chromium.org/1497313002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297849 0039d316-1c4b-4281-b951-d872f2087c98
Fix a bug that left branches tracking a dead branch if both their parent
and grand-parent were left with no changes after a "rebase-update" step.
Given the following initial state:
$ git map-branches -v
origin/master
a
b
c * [ ahead 1 ]
without this patch, a "git rebase-update" on this tree state would
leave the branch "c" as tracking a non-existing branch "a":
$ git recursive-rebase
a up-to-date
b up-to-date
c up-to-date
Reparented c to track a (was tracking b)
Deleted branch b (was 448d1da).
Deleted branch a (was 448d1da).
$ git map-branches -v
{a:GONE}
c *
with the patch, we record that the branch "c" is tracking must be
updated twice and we end up in a state were "c" is correctly tracking
"origin/master":
$ git recursive-rebase
a up-to-date
b up-to-date
c up-to-date
Reparented c to track origin/master (was tracking b)
Deleted branch b (was 448d1da).
Deleted branch a (was 448d1da).
$ git map-branches -v
origin/master
c * [ ahead 1 ]
BUG=456806
Review URL: https://codereview.chromium.org/1482753002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297792 0039d316-1c4b-4281-b951-d872f2087c98
* When aborting a failed rebase, don't cascade errors if the abort itself
fails.
* When starting a rebase-update cycle, cd to the root of the repo. This avoids
an issue when you run rebase-update from inside of a branch which adds a
new folder.
R=agable@chromium.org
BUG=499031
Review URL: https://codereview.chromium.org/1180673003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295637 0039d316-1c4b-4281-b951-d872f2087c98
Handle KeyboardInterrupt gracefully rather the printing a
backtrace. Most users of these tools don't expect a
backtrace when then hit Ctrl-C.
Also, fix a few other inconsistencies found in the python
startup code of these different scripts:
- always call main function 'main' (rather than 'Main')
- always return 0 from main function
- if main takes args never include argv[0]
Review URL: https://codereview.chromium.org/955993006
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294250 0039d316-1c4b-4281-b951-d872f2087c98
Previously we just added an assert here but better
to simply succeed in this case, while outputting
the intial failure message.
BUG=425696
Review URL: https://codereview.chromium.org/667793005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292687 0039d316-1c4b-4281-b951-d872f2087c98
Don't discard stderr from failed rebase operations
I had an issue where stdout of the failed rebase was
empty but stderr contained:
First, rewinding head to replay your work on top of it...
Dirty index: cannot apply patches (dirty: internal_gyp
third_party/html_office).
Also, in my case the second rebase was actually succeeding
for some reason, which is clearly no expected, so assert
in this case.
BUG=410339
Review URL: https://codereview.chromium.org/645763002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292444 0039d316-1c4b-4281-b951-d872f2087c98
Some options have words separated by underscores. Added options with
same name and underscores replaced by hyphens.
BUG=400953
Review URL: https://codereview.chromium.org/436963005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@288366 0039d316-1c4b-4281-b951-d872f2087c98
Previously a `[depot-tools "rebase-update"]` section would show up in the
.git/config on every `git rebase-update` cycle.
R=agable@chromium.org
BUG=
Review URL: https://codereview.chromium.org/228353003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@263423 0039d316-1c4b-4281-b951-d872f2087c98
For some reason .output doesn't throw an AttributeError, but returns None ,
instead. .stdout is the correct attribute.
R=agable@chromium.org
BUG=
Review URL: https://codereview.chromium.org/212493003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@259695 0039d316-1c4b-4281-b951-d872f2087c98
Somehow some (but not all) git helper scripts got the wrong interpreter. This
fixes them to use /usr/bin/env.
TBR=agable@chromium.org
BUG=
Review URL: https://codereview.chromium.org/212293002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@259522 0039d316-1c4b-4281-b951-d872f2087c98
git-rebase-update - ensure all branches are up to date
git-new-branch - create branches
git-rename-branch - rename a branch while preserving parentage relationships
git-reparent-branch - change the parent of a branch, including rebasing it correctly onto that new parent.
git-squash-branch - collapse a branch into a single commit
git-upstream-diff - show the diff between the current branch and it's upstream branch
git-mark-merge-base - explicitly set what you want the above tools to consider the merge-base for the current branch.
R=agable@chromium.org, hinoka@chromium.org, stip@chromium.org, szager@chromium.org
BUG=261738
Review URL: https://codereview.chromium.org/184253003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@259520 0039d316-1c4b-4281-b951-d872f2087c98