Commit Graph

27 Commits (chrome/3904)

Author SHA1 Message Date
Edward Lesmes 98eda3f3e4 Revert "depot_tools: Run Python scripts using vpython (Part 1)"
This reverts commit d6186f9936.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> depot_tools: Run Python scripts using vpython (Part 1)
> 
> Tbr: iannucci@chromium.org
> Bug: 984182
> Change-Id: If36722e190d305f89d63dce91d0a600ddc34ebe3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748589
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

TBR=iannucci@chromium.org,ehmaldonado@chromium.org

Change-Id: I7686985852608d0703bcbbab137df1ce82b29723
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 984182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1749853
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur d6186f9936 depot_tools: Run Python scripts using vpython (Part 1)
Tbr: iannucci@chromium.org
Bug: 984182
Change-Id: If36722e190d305f89d63dce91d0a600ddc34ebe3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748589
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Raul Tambre 80ee78e7fa Convert print statements to Python 3 style
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>
6 years ago
Henrique Ferreiro fe83cfa6b4 Add --current to rebase the current branch
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>
6 years ago
Henrique Ferreiro 3acdefa9aa Omit "Skipping <branch>" message when unneeded
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>
6 years ago
Sergiy Belozorov b58d4bda63 Add a feature to specify branches to be re-based
Change-Id: I00f1d6716ca5ece647d7ac15471ded25c1f164b2
Reviewed-on: https://chromium-review.googlesource.com/c/1370125
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
6 years ago
Andrew Moylan bfc4082f43 Flush stdout before squash attempt
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>
7 years ago
Robert Iannucci c87e36aaec [git rebase-update] Handle error when chdir'ing to original workdir.
BUG=

Change-Id: I1dc7f20eea3f4b1be9179aa6d77bdee08ab8a04f
Reviewed-on: https://chromium-review.googlesource.com/431576
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
8 years ago
agable 7aa2ddd81d Refactor git_common config and die
R=iannucci@chromium.org
BUG=376099

Review-Url: https://codereview.chromium.org/2075603002
9 years ago
iannucci@chromium.org 0d9e59c6ce Fix rebase-update on windows on git-svn repos.
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
9 years ago
iannucci@chromium.org aa1dfdab66 Fix multi-rename empty branch detection.
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
9 years ago
sdefresne@chromium.org d421f6a477 Fix "git rebase-update" when multiple branch are stale.
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
9 years ago
stip@chromium.org 74374f985f Add a --keep-going flag for people who run rebase-update infrequently.
Review URL: https://codereview.chromium.org/1331263002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@296639 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
iannucci@chromium.org 196809e75b Only chdir in rebase-update if there's a directory to go back to.
TBR=agable@chromium.org
BUG=499031

Review URL: https://codereview.chromium.org/1182713002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295642 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
iannucci@chromium.org dabb78bfd5 Make git-rebase-update a bit more robust
* 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
10 years ago
sbc@chromium.org 013731e832 Handle KeyboardInterrupt consistently in python scripts
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
10 years ago
sbc@chromium.org 8b4900e77f Handle unusual case in rebase-update where second rebase attempt works.
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
10 years ago
sbc@chromium.org 384039b174 Improve error handling in git-rebase-update
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
11 years ago
asanka@chromium.org 4d2a66eeda Fix regexp used for enumerating remotes.
R=szager@chromium.org
BUG=413391

Review URL: https://codereview.chromium.org/598153003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292123 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 937159d61a Fix logic for determing remote name from remote branch.
BUG=413391
R=iannucci@chromium.org,agable@chromium.org

Review URL: https://codereview.chromium.org/567873002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292117 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
pgervais@chromium.org b9f2751b87 Added hyphen-only options
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
11 years ago
iannucci@chromium.org 43f4ecc65e Make git rebase-update more responsive.
Passes through git-fetch's output instead of buffering it.

R=djacques@chromium.org
TBR=agable@chromium.org
BUG=366375

Review URL: https://codereview.chromium.org/264423002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@269080 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org bf157b44ec Fix empty section appearing in git config for every rebase-update.
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
11 years ago
iannucci@chromium.org 512d97d412 Remember what branches we delete and do not try to reparent them in cleanup.
R=agable@chromium.org
BUG=357367

Review URL: https://codereview.chromium.org/214133006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@260704 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org 56a624ac56 Fix the print of the rebase error message, and make the output prettier too.
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
11 years ago
iannucci@chromium.org 97231b5fb5 Fix bad interpreters.
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
11 years ago
iannucci@chromium.org c050a5b2be Add a family of git-commands to assist with the management of multiple CLs/branches.
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
11 years ago