Commit Graph

170 Commits (980d615e7e5d3984053c4553582d53e4ffebe3bd)

Author SHA1 Message Date
Edward Lemur 8c66565649 gclient: Fix applying patches to branch heads.
Bug: 956807
Change-Id: I2eed6db1f338806812fca778986d51b0a007eddd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1592577
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Bruce Dawson 9c06201209 Fix multiple confusingly escaped regex strings
Python (prior to 3.8) treats meaningless string escape sequences as if
they were a slash followed by the character. That is, '\w' == '\\w'.
Python 3.8 rejects this, and it's confusing. This change fixes seven of these
regex strings found in depot_tools (through a regex search, natch). Most of
the fixes don't actually change the value of the strings, and this was
manually verified:

>>> '(/c(/.*/\+)?)?/(\d+)(/(\d+)?/?)?$' == r'(/c(/.*/\+)?)?/(\d+)(/(\d+)?/?)?$'
True
>>> '#\s*OWNERS_STATUS\s+=\s+(.+)$' == r'#\s*OWNERS_STATUS\s+=\s+(.+)$'
True
>>> 'COM\d' == r'COM\d'
True
>>> '^\s+Change-Id:\s*(\S+)$' == r'^\s+Change-Id:\s*(\S+)$'
True
>>> 'ETag:\s+([a-z0-9]{32})' == r'ETag:\s+([a-z0-9]{32})'
True

Two exceptions were the regex expressions in filter_demo_output.py and scm.py.
These were turned into raw strings despite this changing the value of the
string passed to re. This works because re supports the \x, \d, \w, \t, and
other escape sequences needed to make this work.

TL;DR - use raw strings for regex to avoid melting your brain. If bulk changing
regex strings to raw watch out for double-slashes.

Bug: 958138
Change-Id: Ic45264cfc63e8bae9cfcffe2cd88a57c2d3dcdae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1590534
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
6 years ago
Edward Lemur 9a5e3bd817 gclient_scm: Simplify fetching refs.
Bug: 874501, 942229
Change-Id: Ie9896e8a289e32a1b468ed5fa51c95a81970bdf8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1544802
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Raul Tambre b946b2389c Improve gclient Python 3 compatibility
This enables gclient sync and gclient runhooks to run, barring hook script failures.
git cl upload also now works.

The scripts still work with Python 2.
There are no intended behaviour changes.

Bug: 942522
Change-Id: I2ac587b5f803ba7f5bb5e412337ce049f4b1a741
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1524583
Commit-Queue: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
6 years ago
Michael Spang 2f3c820ae3 Simplify GIT.IsValidRevision
We should pass --verify to tell rev-parse that we're just testing,
and use the ^{commit} dereference operator to avoid the hack of
removing a character from the commit hash to see if it's really
in the object database.

Bug: 938627

Change-Id: Ic6ea898b0a5a6a1a5d706c7586c7208ec8ca2ce2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1504104
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov 2f727917ac git cl: add reviewers and ccs to git push command if possible.
Also fix a typo in ValidateEmail function which didn't support
email addresses with '-' in them, e.g., infra-dev@chromium.org.

R=ehmaldonado

Bug: 875089
Change-Id: I2d73c1473527c9bf62e25e9f88250196b783fcb0
Reviewed-on: https://chromium-review.googlesource.com/c/1242849
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur ca7d881540 Reland "Reland "gclient_scm: Use cherry-picking instead of rebasing.""
Abort any cherry-picks before applying the patch, so that if the bots are in a
bad state, we don't fail.

Original change's description:
> Reland "gclient_scm: Use cherry-picking instead of rebasing."
>
> The failures were caused by:
>  1 - When one change (call it #2) has been uploaded on top of another (#1),
>      and (#1) has already landed, git cherry-pick complains that the range
>      '<merge-base>..<change #2>' contains empty commits, since the contents
>      of (#1) are already present in the tree.
>  2 - We did not abort the cherry-picking when 'git cherry-pick' failed,
>      so a failure made all further CLs in that bot fail.
>
> This CL fixes it and prevents further regressions.
>
> Original change's description:
> > gclient_scm: Use cherry-picking instead of rebasing.
> >
> > Currently gclient might include extra commits when applying patches.
> > For example, in this case we checkout |patch| and rebase it on top of |base|,
> > thus including an |extra commit| that we shouldn't.
> >
> > o master
> > |
> > . o patch
> > |/
> > o extra commit
> > |
> > o base (what gclient synced src at)
> >
> > This change uses the merge-base between |patch| and |master| to cherry-pick only
> > the changes belonging to the patch.
> >
> > Bug: 850812
> > Change-Id: I138192f96bc62b1bb19b0e1ad952c8f8c67631c4
> > Reviewed-on: https://chromium-review.googlesource.com/1137052
> > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> > Reviewed-by: Aaron Gable <agable@chromium.org>
>
> Bug: 850812
> Change-Id: I83f38d0a258df3f5cd89e277f0d648badff29a22
> Reviewed-on: https://chromium-review.googlesource.com/1139554
> Reviewed-by: Aaron Gable <agable@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

Bug: 850812
Change-Id: Ic65bda67c792bd7af5ec013a62d9615d1498eb3a
Reviewed-on: https://chromium-review.googlesource.com/1142805
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
John Budorick 2c984a03ca Revert "Reland "gclient_scm: Use cherry-picking instead of rebasing.""
This reverts commit f9afc77f28.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=864301#c10

Original change's description:
> Reland "gclient_scm: Use cherry-picking instead of rebasing."
> 
> The failures were caused by:
>  1 - When one change (call it #2) has been uploaded on top of another (#1),
>      and (#1) has already landed, git cherry-pick complains that the range
>      '<merge-base>..<change #2>' contains empty commits, since the contents
>      of (#1) are already present in the tree.
>  2 - We did not abort the cherry-picking when 'git cherry-pick' failed,
>      so a failure made all further CLs in that bot fail.
> 
> This CL fixes it and prevents further regressions.
> 
> Original change's description:
> > gclient_scm: Use cherry-picking instead of rebasing.
> >
> > Currently gclient might include extra commits when applying patches.
> > For example, in this case we checkout |patch| and rebase it on top of |base|,
> > thus including an |extra commit| that we shouldn't.
> >
> > o master
> > |
> > . o patch
> > |/
> > o extra commit
> > |
> > o base (what gclient synced src at)
> >
> > This change uses the merge-base between |patch| and |master| to cherry-pick only
> > the changes belonging to the patch.
> >
> > Bug: 850812
> > Change-Id: I138192f96bc62b1bb19b0e1ad952c8f8c67631c4
> > Reviewed-on: https://chromium-review.googlesource.com/1137052
> > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> > Reviewed-by: Aaron Gable <agable@chromium.org>
> 
> Bug: 850812
> Change-Id: I83f38d0a258df3f5cd89e277f0d648badff29a22
> Reviewed-on: https://chromium-review.googlesource.com/1139554
> Reviewed-by: Aaron Gable <agable@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

TBR=agable@chromium.org,ehmaldonado@chromium.org,jbudorick@chromium.org

Change-Id: I2138757899abd6eb9bece2dac3a25676effafdf3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 850812
Reviewed-on: https://chromium-review.googlesource.com/1142624
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
7 years ago
Edward Lemur f9afc77f28 Reland "gclient_scm: Use cherry-picking instead of rebasing."
The failures were caused by:
 1 - When one change (call it #2) has been uploaded on top of another (#1),
     and (#1) has already landed, git cherry-pick complains that the range
     '<merge-base>..<change #2>' contains empty commits, since the contents
     of (#1) are already present in the tree.
 2 - We did not abort the cherry-picking when 'git cherry-pick' failed,
     so a failure made all further CLs in that bot fail.

This CL fixes it and prevents further regressions.

Original change's description:
> gclient_scm: Use cherry-picking instead of rebasing.
>
> Currently gclient might include extra commits when applying patches.
> For example, in this case we checkout |patch| and rebase it on top of |base|,
> thus including an |extra commit| that we shouldn't.
>
> o master
> |
> . o patch
> |/
> o extra commit
> |
> o base (what gclient synced src at)
>
> This change uses the merge-base between |patch| and |master| to cherry-pick only
> the changes belonging to the patch.
>
> Bug: 850812
> Change-Id: I138192f96bc62b1bb19b0e1ad952c8f8c67631c4
> Reviewed-on: https://chromium-review.googlesource.com/1137052
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Aaron Gable <agable@chromium.org>

Bug: 850812
Change-Id: I83f38d0a258df3f5cd89e277f0d648badff29a22
Reviewed-on: https://chromium-review.googlesource.com/1139554
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
John Budorick 40bacee96a Revert "gclient_scm: Use cherry-picking instead of rebasing."
This reverts commit fb78b368de.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=864301

Original change's description:
> gclient_scm: Use cherry-picking instead of rebasing.
> 
> Currently gclient might include extra commits when applying patches.
> For example, in this case we checkout |patch| and rebase it on top of |base|,
> thus including an |extra commit| that we shouldn't.
> 
> o master
> |
> . o patch
> |/
> o extra commit
> |
> o base (what gclient synced src at)
> 
> This change uses the merge-base between |patch| and |master| to cherry-pick only
> the changes belonging to the patch.
> 
> Bug: 850812
> Change-Id: I138192f96bc62b1bb19b0e1ad952c8f8c67631c4
> Reviewed-on: https://chromium-review.googlesource.com/1137052
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Aaron Gable <agable@chromium.org>

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

Change-Id: I57299e60e58eac5656dc88937c622d0d14c4ba37
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 850812
Reviewed-on: https://chromium-review.googlesource.com/1139553
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
7 years ago
Edward Lemur fb78b368de gclient_scm: Use cherry-picking instead of rebasing.
Currently gclient might include extra commits when applying patches.
For example, in this case we checkout |patch| and rebase it on top of |base|,
thus including an |extra commit| that we shouldn't.

o master
|
. o patch
|/
o extra commit
|
o base (what gclient synced src at)

This change uses the merge-base between |patch| and |master| to cherry-pick only
the changes belonging to the patch.

Bug: 850812
Change-Id: I138192f96bc62b1bb19b0e1ad952c8f8c67631c4
Reviewed-on: https://chromium-review.googlesource.com/1137052
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Aaron Gable f4068aa3ea Use core.quotePath=false for more git diffs
This includes a minor refactor so that some gclient_scm methods
can all share the same core.quotePath specifier.

R=iannucci

Bug: 792302
Change-Id: Iaadf190f5c0666787cf7c2ccda88d6dba9aace9b
Reviewed-on: https://chromium-review.googlesource.com/823131
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
7 years ago
Aaron Gable 7817f02543 Reland "Use core.quotePath=false when git is listing files"
This is a reland of 9219d35688

The original was reverted due to a typo (core,quotePath instead
of core.quotePath). This version is fixed.

Original change's description:
> Use core.quotePath=false when git is listing files
>
> This prevents git from putting quotes around some file names
> (those that have astral-plane characters) and not around others.
>
> R=maruel
>
> Bug: 792302
>
> Change-Id: I3b6a6b36c4720116de811b40177b59aa25c263db
> Reviewed-on: https://chromium-review.googlesource.com/815454
> Commit-Queue: Aaron Gable <agable@chromium.org>
> Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>

Bug: 792302
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Change-Id: I28d2260948aaf63bd865888c2f60e4cdee9aea48
Reviewed-on: https://chromium-review.googlesource.com/822990
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Robbie Iannucci 6aaee3065c Revert "Use core.quotePath=false when git is listing files"
This reverts commit 9219d35688.

Reason for revert: unfortunately this says "core,quotePath" and since it includes recipe changes, we need something that the roller can munch on :(

Original change's description:
> Use core.quotePath=false when git is listing files
> 
> This prevents git from putting quotes around some file names
> (those that have astral-plane characters) and not around others.
> 
> R=​maruel
> 
> Bug: 792302
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Change-Id: I3b6a6b36c4720116de811b40177b59aa25c263db
> Reviewed-on: https://chromium-review.googlesource.com/815454
> Commit-Queue: Aaron Gable <agable@chromium.org>
> Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>

TBR=maruel@chromium.org,agable@chromium.org

Change-Id: I226388f19024403240a1443eb2b878b9293220e1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 792302
Reviewed-on: https://chromium-review.googlesource.com/821671
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
7 years ago
Aaron Gable 9219d35688 Use core.quotePath=false when git is listing files
This prevents git from putting quotes around some file names
(those that have astral-plane characters) and not around others.

R=maruel

Bug: 792302
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Change-Id: I3b6a6b36c4720116de811b40177b59aa25c263db
Reviewed-on: https://chromium-review.googlesource.com/815454
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
7 years ago
Pierre-Antoine Manzagol fc1c6f4c1f Correct Git show's path format on Windows
_CalculateAddedDeps calls into depot tools' scm.py GetOldContents to
compare previous and current versions of the DEPS file. GetOldContents
attempts to 'git show <sha>:<path>'. The problem on Windows is that path
uses '\' but git show seems to want a posix path. Git show therefore
doesn't find the file and returns an empty output, leading presubmit to
think all the deps are new.

Bug:725933
Change-Id: Ifbbfbcba4be466d9be623826818fd191bd2ca525
Reviewed-on: https://chromium-review.googlesource.com/514142
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
8 years ago
Daniel Cheng d67e7158df Fix GetOldContents() to return an empty string if the file didn't exist.
Bug: 700108
Change-Id: I9010aa3b4aa467c91b93ffac924b3ec5a16cfaa2
Reviewed-on: https://chromium-review.googlesource.com/476590
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
8 years ago
Daniel Cheng 7a1f04d377 Implement presubmit API to get the old contents of an affected file.
BUG=702851

Change-Id: I6f005d19524cbb8b361d3fcb0b91912885c46e00
Reviewed-on: https://chromium-review.googlesource.com/456755
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
8 years ago
Aaron Gable 208db564b0 Remove git-svn support from scm.py
None of these methods are called anymore.

BUG=475320

Change-Id: I2f21a326069cf3e65af179f4e61fa15093b73b07
Reviewed-on: https://chromium-review.googlesource.com/423122
Reviewed-by: Katie Thomas <katthomas@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable 6dd3e7146e Remove scm.SVN from depot_tools
This code is no longer imported by anything.

BUG=475320

Change-Id: Ib03f1185c3d90e271f4ee4bff6ad0184454facb8
Reviewed-on: https://chromium-review.googlesource.com/422463
Reviewed-by: Katie Thomas <katthomas@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
mmoss@chromium.org c349971db4 Fix some path processing to work better on Windows.
R=hinoka@chromium.org
BUG=555036

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297698 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
primiano@chromium.org 1c1273893e Reland "Make gclient ready for the Blink (DEPS to main project)"
Reland crrev.com/743083002, which was reverted in crrev.com/796053002
due to some test flakiness, probably related with an old version of Git on
the bots. Relanding now that the infra has been updated to Trusty (plus
adding some de-flake precautions).

Original CL Description:
Make gclient ready for the Blink (DEPS to main project) transition

This CL makes gclient understand correctly whether a git project is
being moved from DEPS to an upper project and vice-versa.
The driving use case for this is the upcoming Blink merge, where
third_party/Webkit will be removed from DEPS (and .gitignore) and will
become part of the main project.

At present state, gclient leaves the .git folder around when a project
is removed from DEPS, and that causes many problems.

Furthermore this CL solves the performance problem of bisecting across
the merge point. The subproject's (Blink) .git/ folder is moved to a
backup location (in the main checkout root) and is restored when moving
backwards, avoiding a re-fetch when bisecting across the merge point.

BUG=431469

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294082 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
primiano@chromium.org a64c0b083b Revert of Make gclient ready for the Blink (DEPS to main project) transition (patchset #6 id:180001 of https://codereview.chromium.org/743083002/)
Reason for revert:
The test intoruced is flake (see crrev.com/753543006/).
Need to look into that with more patience as it reproduces only on precise.


Original issue's description:
> Make gclient ready for the Blink (DEPS to main project) transition
> 
> This CL makes gclient understand correctly whether a git project is
> being moved from DEPS to an upper project and vice-versa.
> The driving use case for this is the upcoming Blink merge, where
> third_party/Webkit will be removed from DEPS (and .gitignore) and will 
> become part of the main project.
> 
> At present state, gclient leaves the .git folder around when a project
> is removed from DEPS, and that causes many problems. 
> 
> Furthermore this CL solves the performance problem of bisecting across
> the merge point. The subproject's (Blink) .git/ folder is moved to a
> backup location (in the main checkout root) and is restored when moving
> backwards, avoiding a re-fetch when bisecting across the merge point. 
> 
> BUG=431469
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=293329

TBR=iannucci@chromium.org,maruel@chromium.org,jochen@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=431469

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@293352 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
primiano@chromium.org fcf03763e0 Make gclient ready for the Blink (DEPS to main project) transition
This CL makes gclient understand correctly whether a git project is
being moved from DEPS to an upper project and vice-versa.
The driving use case for this is the upcoming Blink merge, where
third_party/Webkit will be removed from DEPS (and .gitignore) and will 
become part of the main project.

At present state, gclient leaves the .git folder around when a project
is removed from DEPS, and that causes many problems. 

Furthermore this CL solves the performance problem of bisecting across
the merge point. The subproject's (Blink) .git/ folder is moved to a
backup location (in the main checkout root) and is restored when moving
backwards, avoiding a re-fetch when bisecting across the merge point. 

BUG=431469

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@293329 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
mmoss@chromium.org 6e7202bd11 Fix gclient branch ref mangling and allow --force branch switches.
R=iannucci@chromium.org, maruel@chromium.org
BUG=410959

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291883 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@google.com 6895317a7d Revert of scm.GIT.IsValidRevision: Only return True if the given object is a commit (https://codereview.chromium.org/329823002/)
Reason for revert:
Speculative revert to see if this is the cause of auto_roll_test.py to fail in build/ presubmit.

Original issue's description:
> scm.GIT.IsValidRevision: Only return True if the given object is a commit
> 
> BUG=383476
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=276487

TBR=iannucci@chromium.org,maruel@chromium.org,borenet@google.com
NOTREECHECKS=true
NOTRY=true
BUG=383476

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@276493 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
borenet@google.com 565b1780c6 scm.GIT.IsValidRevision: Only return True if the given object is a commit
BUG=383476

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@276487 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 6d8115d009 Eliminate all interactive terminal prompts from git.
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@265735 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
borenet@google.com b09097a42c gclient: print a warning if a dep would get deleted or moved in the future
BUG=skia:1638

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@262761 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
nodir@chromium.org ead4c7e58f Revert of revert and fix "Now trychange can...
Bug=359292
Original commit: b1391c6a68
Revert: 8e5f7d308fde74c52e321587649c16568e4a9644

Original commit comment:

> Now trychange can store patches in a Git repo

> A git patch repo is cloned to .git/git-try/patches-git, if was not
> cloned before. Otherwise, changes are pulled. Then a patch is committed a
> pushed.

> --revision=auto (Git only) is resolved to the revision the diff is genera
> against.

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@261247 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
nodir@chromium.org e0536ff702 Revert "Now trychange can store patches in a..."
This reverts commit b1391c6a68.

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@261220 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
nodir@chromium.org b1391c6a68 Now trychange can store patches in a Git repo
A git patch repo is cloned to .git/git-try/patches-git, if was not
cloned before. Otherwise, changes are pulled. Then a patch is committed and
pushed.

--revision=auto (Git only) is resolved to the revision the diff is generated
against.

R=stip@chromium.org, agable@chromium.org, iannucci@chromium.org, maruel@chromium.org
BUG=325882

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@260471 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
thakis@chromium.org d0b0a5b08c Revert of Another attempt: gclient: delete mismatching checkouts (https://codereview.chromium.org/183283003/)
Reason for revert:
Broke `gclient sync` for me, failing with:

Error: 1> Can't update/checkout /Volumes/MacintoshHD2/src/chrome-git/src if an unversioned directory is present. Delete the directory and try again.


For someone else, it broke it with:

% gclient sync

________ unmanaged solution; skipping src

Error: Command svn info --xml returned non-zero exit status 1 in /Users/pawliger/chromium/src/.

<?xml version="1.0" encoding="UTF-8"?>

<info>

svn: E155007: '/Users/pawliger/chromium/src' is not a working copy

Original issue's description:
> Another attempt: gclient: delete mismatching checkouts
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=255930

TBR=iannucci@chromium.org,szager@chromium.org,maruel@chromium.org,mmoss@chromium.org,borenet@google.com
NOTREECHECKS=true
NOTRY=true

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@256005 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
borenet@google.com 7ff04292ac Another attempt: gclient: delete mismatching checkouts
Review URL: https://codereview.chromium.org/183283003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@255930 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 6c2b49d392 Revert "Re-re-land gclient deletion of mismatching checkouts again"
This reverts commit 6ff5448534.

'fetch --nohooks chromium' is broken with this change.

BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@253640 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
borenet@google.com 6ff5448534 Re-re-land gclient deletion of mismatching checkouts again
Review URL: https://codereview.chromium.org/164053003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@253616 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
mmoss@chromium.org 50fd47f55f Revert 250482 "Re-reland r245404 ("If the destination directory ..."
> Re-reland r245404 ("If the destination directory doesn't contain the desired repo, delete it")
> 
> BUG=
> 
> Review URL: https://codereview.chromium.org/133073015

TBR=borenet@google.com

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@250878 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
borenet@google.com 255b5d97da Re-reland r245404 ("If the destination directory doesn't contain the desired repo, delete it")
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@250482 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
ilevy@chromium.org 4380c80db7 Fix GenerateDiff -- don't strip whitespace.
BUG=259434
R=iannucci

Review URL: https://chromiumcodereview.appspot.com/18408006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@211483 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
bratell@opera.com 82b91cd1a8 Replace --no-pager with GIT_PAGER=cat
--no-pager looks ugly in logs and output and makes commands harder to
read. Setting an environment variable is better.

This is a followup to https://chromiumcodereview.appspot.com/14104005/
which added --no-pager.

Review URL: https://chromiumcodereview.appspot.com/18173003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@210503 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org 224ba24fef Fix bug with parsing capitalized git shas
Fix identification of shas that contain capitalized
hexadecimal characters.  Addresses comments from
http://crrev.com/18262002/

R=maruel@chromium.org

Review URL: https://chromiumcodereview.appspot.com/18292005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@210429 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
iannucci@chromium.org 396e1a6d9e If we're running in nohooks mode, don't bother to accumulate file_list in gclient.
This enables significant time savings, especially since file_list only exists to
enable file-specific hooks (which, AFAIK, nothing actually uses). On a z620
(linux) using the cached git repos, a first-time `gclient sync --nohooks` takes:
  * (with)    131.06s user 14.10s  system 117% cpu 2:03.89 total
  * (without) 482.13s user 189.35s system 144% cpu 7:45.63 total

This change makes nohooks cause file_list to be None if we don't need to
accumulate it, and updates GitWrapper and SvnWrapper appropriately.

R=szager@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/18541006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@210026 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org a41249c2b3 Misc gclient cleanup
- Use config --local for properties that should be local.
- Remove git fetch retry logic, it should not be necessary
  with the googlesource hosts.
- Include .strip() in GIT.Capture, simplifying other calls.
- Safer testing of whether dep revision is a sha.
- Fix refs/remotes/ DEPS branch detection

Review URL: https://chromiumcodereview.appspot.com/18262002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@209825 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
mcgrathr@chromium.org 9249f64cf4 Pass --no-renames to git diff
If ~/.gitconfig contains:
	[diff]
		renames = "true"
then git diff --name-status will produce output that confuses the parsing
in svm.GIT.CaptureStatus and git diff will produce output that confuses the
patch command on trybots.  Passing --no-renames explicitly counteracts this.

Review URL: https://chromiumcodereview.appspot.com/16057018

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@203778 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
bratell@opera.com f267b0e55c Fix 236148: Avoid triggering a pager in internal git commands.
BUG=236148

Review URL: https://chromiumcodereview.appspot.com/14104005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@197872 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
pkasting@chromium.org 0db557ce7a Reland r195308, r195328, and r195363, which use --internal-diff on svn 1.7+.
This time, do not use the --config-dir hack on svn < 1.7 for the diff command
that runs against a remote URL.  This seems to trigger auth prompts (see revert
comments on https://codereview.chromium.org/14297017/ ).

Review URL: https://chromiumcodereview.appspot.com/14084009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@196263 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
digit@chromium.org dc112ac587 Remove gclient_utils.RemoveDirectory().
The 'RemoveDirectory()' function in gclient_utils is deprecated and
rmtree() should be used instead for consistency.

This patch modifies all clients in depot_tools to use rmtree() instead
and removes the RemoveDirectory function.

+ The SVNWrapperTestCase.testRevertNoDotSvn() mocking
  expectation has been slightly changed. This was required
  because the test invokes code that used to call
  gclient_utils.RemoveDirectory() directly, while only
  gclient_utils.rmtree() was mocked.

BUG=NONE
R=maruel@chromium.org, ilevy@chromium.org
TEST=manually run gclient_utils_test / gclient_smoketest / scm_unittest / gclient_scm_test

Review URL: https://chromiumcodereview.appspot.com/14134010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@196133 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
jam@chromium.org 5b792f55f6 Revert 195308 "Tweak GenerateDiff:"
Reverting r195363, r195328 and r195308. gcl upload is hanging for me unless I revert these changes.

f:\src\chrome3\src>gcl upload o0m7

at this point, there's no output. If I press enter, I get:


Got an exception
Command svn diff --config-dir c:\users\jabdel~1\appdata\local\temp\tmp7dwbyp -r 195324:head svn://chrome-svn/chrome/trun
k/src/webkit/glue/dom_operations_unittest.cc returned non-zero exit status 1 in f:\src\chrome3\src
Authentication realm: <svn://chrome-svn:3690> 0039d316-1c4b-4281-b951-d872f2087c98
Password for 'jabdelmalek':
Authentication realm: <svn://chrome-svn:3690> 0039d316-1c4b-4281-b951-d872f2087c98

> Tweak GenerateDiff:
> 
> * Update comment for accuracy
> * Keep the base diff command in a variable; this fixes an oversight where GenerateDiff would run svn diff without the --config-dir hack, and makes later refactoring easy
> * Apply review comments from https://codereview.chromium.org/14247007/ to existing code
> 
> Review URL: https://chromiumcodereview.appspot.com/14366029

TBR=pkasting@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195422 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
jam@chromium.org 6e905a684e Revert 195328 "Use --internal-diff on svn 1.7+ to slightly reduc..."
Reverting r195363, r195328 and r195308. gcl upload is hanging for me unless I revert these changes.

f:\src\chrome3\src>gcl upload o0m7

at this point, there's no output. If I press enter, I get:


Got an exception
Command svn diff --config-dir c:\users\jabdel~1\appdata\local\temp\tmp7dwbyp -r 195324:head svn://chrome-svn/chrome/trun
k/src/webkit/glue/dom_operations_unittest.cc returned non-zero exit status 1 in f:\src\chrome3\src
Authentication realm: <svn://chrome-svn:3690> 0039d316-1c4b-4281-b951-d872f2087c98
Password for 'jabdelmalek':
Authentication realm: <svn://chrome-svn:3690> 0039d316-1c4b-4281-b951-d872f2087c98

> Use --internal-diff on svn 1.7+ to slightly reduce disk thrashing.
> 
> This just saves the need to create and remove an empty directory on every call to GenerateDiff.
> 
> Review URL: https://chromiumcodereview.appspot.com/14064017

TBR=pkasting@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195421 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
jam@chromium.org 1ba43e2edd Revert 195363
Reverting r195363, r195328 and r195308. gcl upload is hanging for me unless I revert these changes.

f:\src\chrome3\src>gcl upload o0m7

at this point, there's no output. If I press enter, I get:


Got an exception
Command svn diff --config-dir c:\users\jabdel~1\appdata\local\temp\tmp7dwbyp -r 195324:head svn://chrome-svn/chrome/trun
k/src/webkit/glue/dom_operations_unittest.cc returned non-zero exit status 1 in f:\src\chrome3\src
Authentication realm: <svn://chrome-svn:3690> 0039d316-1c4b-4281-b951-d872f2087c98
Password for 'jabdelmalek':
Authentication realm: <svn://chrome-svn:3690> 0039d316-1c4b-4281-b951-d872f2087c98
Username: svn: Can't read stdin: End of file found


"Fix typo."

> Fix typo.
> 
> Review URL: https://chromiumcodereview.appspot.com/13987010

TBR=pkasting@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195420 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago