Commit Graph

170 Commits (980d615e7e5d3984053c4553582d53e4ffebe3bd)

Author SHA1 Message Date
pkasting@chromium.org 0a753d6bb2 Fix typo.
Review URL: https://chromiumcodereview.appspot.com/13987010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195363 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
pkasting@chromium.org 28de290fe3 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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195328 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
pkasting@chromium.org aae3d86d46 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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195308 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
pkasting@chromium.org 917ea7fa26 Removes DiffItem, which was unused, and moves _DiffItemInternal below GenerateDiff, now its lone caller.
No other code changes, so should be no behavioral change.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195262 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
pkasting@chromium.org 4755b58b4c Revert 194990 "Second take at handling users with locally overri..."
> Second take at handling users with locally overridden diff-cmds.
> 
> The first take at https://chromiumcodereview.appspot.com/14130006 tried to pass
> "--diff-cmd diff", which doesn't work for e.g. Windows cmd users who don't have
> a "diff" executable installed.
> 
> This take instead passes the "--internal-diff" switch which tells svn to ignore
> any diff-cmd set locally and use its internal diff engine at all times.
> 
> While implementing this I found that the existing code tried to work around this
> problem in a different way, by setting up a bogus config dir.  Since that
> doesn't seem to work for me, and shouldn't be necessary with this patch anyway,
> removed that code.
> 
> Review URL: https://chromiumcodereview.appspot.com/14050007

TBR=pkasting@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195009 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
pkasting@chromium.org 07258f5a1d Second take at handling users with locally overridden diff-cmds.
The first take at https://chromiumcodereview.appspot.com/14130006 tried to pass
"--diff-cmd diff", which doesn't work for e.g. Windows cmd users who don't have
a "diff" executable installed.

This take instead passes the "--internal-diff" switch which tells svn to ignore
any diff-cmd set locally and use its internal diff engine at all times.

While implementing this I found that the existing code tried to work around this
problem in a different way, by setting up a bogus config dir.  Since that
doesn't seem to work for me, and shouldn't be necessary with this patch anyway,
removed that code.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@194990 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
jam@chromium.org ff1197b553 Revert 194740 "Explicitly pass "--diff-cmd diff" to "svn diff", ..."
On Windows, I got the following error:
f:\src\chrome2\src>gcl commit n3d2
Loaded authentication cookies from C:\Users\jabdelmalek/.codereview_upload_cookies
Running presubmit commit checks ...
  checking owners took a long time: 906ms
Got an exception
Command svn diff --diff-cmd diff --config-dir c:\users\jabdel~1\appdata\local\temp\tmpu7bui5 content\browser\web_content
s\web_contents_impl.cc returned non-zero exit status 1 in f:\src\chrome2\src
Index: content/browser/web_contents/web_contents_impl.cc
===================================================================

svn: Can't start process 'diff': The system cannot find the file specified.

> Explicitly pass "--diff-cmd diff" to "svn diff", for users who have set some other diff tool.
> 
> Review URL: https://chromiumcodereview.appspot.com/14130006

TBR=pkasting@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@194945 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
pkasting@chromium.org 7c712c0d7e Explicitly pass "--diff-cmd diff" to "svn diff", for users who have set some other diff tool.
Review URL: https://chromiumcodereview.appspot.com/14130006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@194740 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
szager@chromium.org c51def3ff4 Restore previous behavior of GetSha1ForSvnRev, so unit tests pass.
Review URL: https://chromiumcodereview.appspot.com/11148019

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@161909 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
szager@google.com 312a6a4e7a Fix safesync_url handling for git.
Takes into account the new submodule-enabled repository layout.
Review URL: https://codereview.chromium.org/11098064

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@161403 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
wittman@chromium.org 492a368f6d Fix error syncing to LKGR due to misparsing of Cygwin git-svn output.
BUG=138104
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@150952 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
shouqun.liu@intel.com 13b522c1aa Fix the svn version check issue, append '--quiet' to get svn version string.
In some enviroments (eg, OSX zh_CN), use 'svn --version' and splitting string
may get error version string. Use 'svn --version --quiet' to do stable svn
version check, which directly returns version string such as '1.7.0'.

BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@147670 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 8147386697 Fix skipping update for git dependency.
'git rev-parse foo' with foo being any 40 character hex string will succeed.
Strip one char to force git to do a proper hash table lookup.

TBR=bauerb@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@144481 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org ea15cb7791 Make checkout.*.prepare() delete the svn:ignored files.
Add corresponding support to scm.SVN.Revert() to clobber the svn:ignore'd files.

This makes the commit queue remove all the unversioned files, which could have
improved its stability. It failed in practice to improve it but it's still a
good thing to do overall.

R=petermayo@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/10355014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@135333 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 6208757463 Fix an error in gclient revert where a directory is unexpected and locked
This would spurious try job failures because the gclient revert step would throw
an exception.

R=cmp@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/10169034

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@133799 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
bashi@chromium.org fcffd48174 Fix compatibility with Xcode4.3 git
Xcode 4.3 git returns the version like below:

git version 1.7.7.5 (Apple Git-26)

Modify GIT.AssertVersion to accept such input.

Also modify tests/gclient_scm_test.py to pass tests, but not sure
the fix is collect.

BUG=chromium:115576
TEST=ran tests/gclient_scm_test.py

Review URL: http://codereview.chromium.org/9443047

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@123399 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
scottbyer@chromium.org 33167331d6 Make sure to remove color output from patches uploaded for try jobs (and other
things).

Review URL: http://codereview.chromium.org/9442028

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@123329 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 7d65467345 Fix compatibility with svn 1.7.
svn info --xml will return
<entry (...) revision="Resource is not under version control."> for
new files, causing an exception in the parsing code.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/9110010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@116522 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
dbeam@chromium.org e5d1e61dc3 [depot_tools] Adding safesync_url for git and git-svn checkouts.
R=maruel@chromium.org
TEST=Configure a checkout using the NewGitWorkflow with a safesync_url and everything works (though possibly with a really long git svn fetch time).
BUG=106015

Review URL: http://codereview.chromium.org/8382030

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@115011 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org f94e3f1dc3 Fix a regression introduced in r114262, cwd must be a named argument to subprocess2.Popen().
Not sure why pylint didn't catch it. :/

TBR=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8937010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@114270 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 80a9ef1e12 Enforce cwd for GIT functions
GIT.CaptureStatus was assuming os.getcwd() was using all the time, which isn't
true when using trychange.py --sub_rep XXX.

R=dpranke@chromium.org
TEST=
BUG=


Review URL: http://codereview.chromium.org/8930002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@114264 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org d579fcf951 Enforces using cwd in all svn calls.
That helps weed out some issues faces with svn plus helped me figure out some
misuses.

Most of the commands have been implicitly depending on os.getcwd(). This change
makes it always consistent and clear when dependence on the current directory is
needed.

Remove default arguments to scm.SVN.GenerateDiff and a few other calls to be
sure the refactoring was done right.

R=dpranke@chromium.org
BUG=
TEST=make sure most commands aren't broke


Review URL: http://codereview.chromium.org/8771042

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@114262 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
supersat@chromium.org 56f4c47459 Reverted accidental commit
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@112766 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
supersat@chromium.org e8043d11af Fix pulling in patches from git subrepos
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@112765 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 8b322b3cb7 Handle cases where '.' show up in svn status and is deleted
This would cause random try job failures, especially when switching around
DEPS <-> svn directory conversion.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8431021

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@108144 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 36ac239bd3 Reapply r104938 "Make svn update not prompt during a sync."
It wasn't broken. The tree collapsed around the same time for unrelated reason.

TBR=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8227036

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@105090 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 7d8b97dc46 Add another error code where gclient sync should retry.
TBR=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8233033

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@104959 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org edb6ea6ea5 Revert r104938 "Make svn update not prompt during a sync."
I'm not sure if it's causing the tree blow up but I'm not taking any chance.

TBR=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8228017

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@104956 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 94aa50fce3 Make svn update not prompt during a sync.
Otherwise it may hangs in various ways.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8199016

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@104938 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 91def9be75 Replace check_output() call site into check_call(). Would throw otherwise.
subprocess2.check_ouput() doesn't accept stdout argument to correctly mimic
subprocess implementation in python 2.7.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7888042

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@101085 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 87e6d33103 Update subprocess2.check_output() to behave like subprocess.check_output().
stderr is not redirected by default. stdout is not allowed.
Both were oversight.
Do not override stdin=None in case the user would response to stderr output for
example.

Increase test coverage.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7860041

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100456 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 73c87e9483 Some callers expect e.stderr to be filled on exception
TBR=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7860038

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100393 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 904af08901 SVN.GenerateDiff assumes SVN.Capture captures stderr.
TBR=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7787008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100270 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org da64d639c1 Remove gclient_utils.CheckCall() usage from scm.py
Remove reference to shutil while at it.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7851001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100182 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 6f323bbad2 Fix when entry is None.
When the tree is not versionned, svn can return <info></info>.

R=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/6899052

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@83020 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org ade9c5953d Fix case where wc_info is not present.
Reapply r80770 "Switch from xml.dom.minidom to xml.etree".

TBR=dpranke@chromium.org
BUG=
TEST=

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80785 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org d25fb8f68b Revert r80770 "Switch from xml.dom.minidom to xml.etree"
Throws exceptions on mac.

R=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/6811020

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80771 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 949d1a6a9e Switch from xml.dom.minidom to xml.etree
The reason of this change (beside deleting 30 lines) is to fix pylint on Mac.
For an unknown reason, it was dying here trying to process the minidom import.

R=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/6799021

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80770 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org c98c0c5249 Make more tests pass on Windows.
Also fix a few issues found along the way.

Tests had regressed a lot. Add a lot of tweaks to make most test pass.

R=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/6792060

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80618 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org e8c2862373 Fix "local variable 'url' referenced before assignment" error.
TBR=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/6792050

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80452 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 31cb48a436 First pass to transition away for gclient_utils.Error and gclient_utils.CheckedCallError.
Make sure every site that catches gclient_utils.Error also catch
subprocess2.CalledProcessError.

BUG=
TEST=

Review URL: http://codereview.chromium.org/6691034

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80339 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org f8b3f94571 When diffing against an old revision, handle the case if a file didn't exists.
Generate a fake diff instance of crashing.

R=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/6721030

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79290 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
bauerb@chromium.org 866276c2ec Add support for wildcards in svn remote configuration.
BUG=none
TEST=manual

Review URL: http://codereview.chromium.org/6598068

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78741 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 5c8c6de7e5 Make sure warnings fail the check when may_prompt=False.
Split presubmit_support.Main() in two to make it simpler.

Handle better the case with unversioned files and add a unit test.

R=dpranke@chromium.org

Review URL: http://codereview.chromium.org/6674059

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78700 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 8c41512962 Improve SVN.Revert() again to work better in reverting svn added directories.
Revert the order back to deleting then svn revert'ing, which is safer than the
reverse. Document a bit better the behavior.

R=dpranke@chromium.org
BUG=none
TEST=commit queue should die less often


Review URL: http://codereview.chromium.org/6681032

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78224 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 924158a717 Add code to correctly revert a svn add'ed file.
Improve test to make sure svn status comes out clean.

TEST=improved unit tests and scm.SVN.Revert() should now do the right thing
BUG=none

Review URL: http://codereview.chromium.org/6650011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77391 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org af45349294 Improve SVN.Revert() to catch more corner cases.
Add a unit test to catch potential regressions. Remove an old test new code broke.

TEST=unit tests
BUG=none

Review URL: http://codereview.chromium.org/6613025

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76805 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
bauerb@chromium.org ade368c40d Add configuration option for upstream branch and improve guessing the svn branch.
The svn branch heuristic does roughly the same thing git-svn does: We first iterate backwards over the history to find the svn URL (like svn://svn.chromium.org/chrome/trunk/src). Then we go through all defined svn-remote section looking for one where the URL is the root of the svn URL (svn://svn.chromium.org/chrome in that case), and the fetch spec looks like "trunk/src:remotes/origin/trunk". If the base URL + left part (trunk/src) is the full URL, the right part (remotes/origin/trunk) is the git ref that is updated when we do a `git svn fetch`! This works for git-svn branches that fetch from trunk as well as milestone branches.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6597004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76364 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 885d6e890f Fix scm.SVN.GetCheckoutRoot() so it is not confused by intermixed checkouts
from the same repository.

TEST=added regression test.
BUG=none

Review URL: http://codereview.chromium.org/6578029

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@75937 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 00fdcb3380 Fix bug introduced in r51121: gcl upload crashes on a 'revived' file.
To reproduce, svn delete a file, then svn merge -c -N the file to revive it.

Also fix a unit test that was broken for a while.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/6576005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@75835 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 07ab60e26f Move reverting code from gclient_scm to scm to be able to reuse the code.
There is 2 changes while moving the code:
- Making externals handling an option.
- Not trapping EnvironmentError.

This code will be reused by the commit queue.

TEST=unit tests
BUG=none

Review URL: http://codereview.chromium.org/6250177

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@74181 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org bec588d9e4 Address review comments in r63832.
TEST=none
BUG=none

Review URL: http://codereview.chromium.org/4157002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@63886 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 0350706c3c Fix retry mechanism to raise when it fails to checkout.
TBR=jochen
BUG=
TEST=

Review URL: http://codereview.chromium.org/4132002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@63832 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org cc1614be9f Improve GIT.CaptureStatus() to work with incorrectly merged local branches.
TEST=none
BUG=none

Review URL: http://codereview.chromium.org/3446014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59944 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ad80e3b96e Simplify GIT.Capture() code to always redirect stderr by default and always throw an exception on failure.
Make gclient_scm_test silent.

Replace raise Exception() with raise gclient_utils.Error().

BUG=54084
TEST=none

Review URL: http://codereview.chromium.org/3353018

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58936 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 54019f3c98 Change scm.SVN.Capture to redirect stderr and throw an exception on call failure.
Added try/except to the places where errors are tolerated.

Renamed scm.SVN.CaptureBaseRevision to CaptureRevision and removed CaptureHeadRevision.

BUG=54084
TEST=none

Review URL: http://codereview.chromium.org/3307016

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58932 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
cbentzel@chromium.org 2aee2298dd gclient: exponential backoff of SCM commands on known failure types.
This starts at 5 seconds (used to be 15) and goes up to ~60 seconds on the tenth round.

BUG=None
TEST=None
Review URL: http://codereview.chromium.org/3326004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58488 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 669600d394 Remove scm.SVN.Run() and all stdout argument to more calls.
BUG=54084
TEST=unit tests

Review URL: http://codereview.chromium.org/3338003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58214 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 17d01795a6 Cleanup the code in gclient_utils to standardize on CheckCall nomenclature.
Simplify code by removing fail_status
Rename print_messages to always
Simplify the doc.

Review URL: http://codereview.chromium.org/3104036

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58201 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 2b9aa8e0b3 Refactor SubprocessCallAndFilter() to remove positional arguments.
This way the function is much more similar to subprocess.call(). Further changes
will be done, to be able to convert all the function, to be able to parallelize
output without corrupting it.

Used pylint to verify call graph correctness, causing some other unrelated
changes.

TEST=unit tests
BUG=none

Review URL: http://codereview.chromium.org/3117039

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57369 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 559c3f89b6 Add stdout param to SubprocessCallAndFilter().
It will eventually replace 'print_messages' and be used to annotate printed
lines when using --jobs.

Review URL: http://codereview.chromium.org/3174020

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57092 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 3a292688b6 Redo of r56893 with fix to support python 2.5.
Original Description:

Remove code duplication and improve style.

Create a Popen function to reduce code duplication.
Use RemoveDirectory where relevant.
Make drover slightly more posix friendly.

Review URL: http://codereview.chromium.org/3199011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57083 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ad0b13da3d Revert "Remove code duplication and improve style."
This reverts commit 850ee065dd.

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56894 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 850ee065dd Remove code duplication and improve style.
Create a Popen function to reduce code duplication.
Use RemoveDirectory where relevant.
Make drover slightly more posix friendly.

Review URL: http://codereview.chromium.org/3126020

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56893 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org f61fc93029 Fix retrying on HTTP 502, my last patch remove this specific case.
svn's client uses a different error format for HTTP 502 and I didn't recall how
the string was formatted. Luckily enough googlecode fails often enough it wasn't
long for me to reproduce the issue. :)

TBR=bradnelson

Review URL: http://codereview.chromium.org/3143030

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56675 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 6133c5b604 Improve the retry algorithm to be much more liberal.
BUG=chromium-os:5305
TEST=gclient sync should be much more resistent

Review URL: http://codereview.chromium.org/3132021

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56565 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 0380707ce2 Remove 'options' usage from scm.py
This is towards cleaning up the mess with 'options' in gclient_scm.py.

Review URL: http://codereview.chromium.org/3106014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56213 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 862ff8ef8d Use # instead of - for the git hash so it can be filtered out by the try server
Review URL: http://codereview.chromium.org/3007040

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@55225 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
gavinp@google.com 3fda4ccee3 Add explicit file rename/cp information to svn rietveld uploads
Right now if you svn cp or svn mv before uploading to rietveld,
there's no description in the patch at all of what was done; so you
get a diff, but it's for who knows what revision of what prior file
to some current version.

For code reviews this kinda works (you ask the guy what it was), but for
trying to apply patches (ala git patch) this fails badly.  This patch
tries to add some metadata to the start of a rietveld patch that
describes these changes: both to a human (who can read them)
and to a potential clever future git-cl (which I'll do next).

The metadata looks like this after checking out a test repo, and
svn cp -r 1 foo nitz; svn cp bar quux; echo be good>>quux

  ### BEGIN SVN COPY METADATA
  #$ svn cp -r 1 foo nitz ### WARNING: note non-trunk copy
  #$ cp bar quux
  ### END SVN COPY METADATA
  Index: nitz
  Index: quux
  ===================================================================
  --- quux	(revision 0)
  +++ quux	(working copy)
  @@ -1,2 +1,3 @@
   hi mom
   hi sister
  +be good

I did a test, and this looks like it works in svn 1.4.4 as well.

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2824035

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@51121 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 9979339aa7 Fix copy-paste error. I saw this exception on breakpad.
TBR=bradnelson

Review URL: http://codereview.chromium.org/2850014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@50232 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 953586a1dd Make scm.py work around even more with bad interaction better svn client and google code.
The novel addition here is to not convert a checkout into an update when no
files were checked out. Also delete the directory to increase the chances of
success.

TEST=wait for google code to fail again
BUG=32783

Review URL: http://codereview.chromium.org/2858003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@49788 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 6e29d572b5 Add pylintrc and fix style for many scripts.
Fix a bug in scm.SVN.DiffItem()

Reduce variable aliasing, fix alignments, etc.

Review URL: http://codereview.chromium.org/2673002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48943 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org c6d170e516 Fix gcl upload with moved files without modification on Windows.
Review URL: http://codereview.chromium.org/2545001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48793 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org 786fb68d39 gclient_scm.py: Make working with git more reliable
I found including a git repo in my DEPS file to be unreliable, esp
since I pinning to a specific commit. Whenever I changed the commit
in the DEPS file, gclient would attempt to do a rebase and this was
failing due to how rebase was being invoked.

While investigating the problem, I decided it might be better to take
a different approach. Namely, when cloning gclient should just checkout
the working tree to a detached HEAD. In this way, gclient can more
easily determine if the user has made any changes in the cloned repo.
Future updates (as long as there are no changes) become a much simpler
operation w/no need to invoke rebase.

This is a series of five commits, but sadly, git cl will squash them
into this single review. Here are the original commit messages:

commit 8cd2213f006a6f4b3f6b8c448a1362b9410d47f1
Author: Jay Soffian <jaysoffian@gmail.com>
Date:   Wed Apr 14 18:29:18 2010 -0400

    Use rev-parse to determine current branch

    Git branch is a so-called porcelain and its output cannot be relied upon;
    use git rev-parse instead.

 gclient_scm.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

commit 1a09e04554acfa2671f9588ee9eef0bdbe677ed2
Author: Jay Soffian <jaysoffian@gmail.com>
Date:   Wed Apr 14 22:16:53 2010 -0400

    Detached HEAD does not always imply rebasing; use an _IsRebasing()
    function instead.

 gclient_scm.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

commit 45308a58c3f1e30b760f13abe3a6288267265fa8
Author: Jay Soffian <jaysoffian@gmail.com>
Date:   Wed Apr 14 22:19:10 2010 -0400

    Clarify comments to use common git terminology

 gclient_scm.py |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

commit 5e5a661b7dd9c83b2c9c35950f3267d15b7e840a
Author: Jay Soffian <jaysoffian@gmail.com>
Date:   Tue May 4 12:15:40 2010 -0400

    Make CaptureStatus use GetUpstreamBranch() instead of assuming 'origin'

 scm.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

commit 42a8bfebd2e1b1be01025c1324d75920ac6eb0e1
Author: Jay Soffian <jaysoffian@gmail.com>
Date:   Wed Apr 14 22:19:29 2010 -0400

    Use a detached HEAD when checking out a tag or commit

    After cloning, if a tag or commit was specified, leave a detached HEAD. This way
    we can reliably detect if the user changed the working tree (since HEAD would no
    longer be detached). Further, this simplifies the code path when the dependency
    is updated to a new tag/commit. As long as HEAD is detached when we update, we
    simply checkout whatever we fetched w/o needing to worry about rebasing.

 gclient_scm.py            |  126 +++++++++++++++++++++++++++++++-------------
 tests/gclient_scm_test.py |    6 +--
 2 files changed, 91 insertions(+), 41 deletions(-)

Review URL: http://codereview.chromium.org/1652007
Patch from Jay Soffian <jaysoffian@gmail.com>.

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48722 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
evan@chromium.org 400f3e7090 Prevent git from using any external diff program that may have been
configured for it when figuring out the patch to upload to the try
server.  This prevents git installations where the diff is configured
to use an interactive tool to work without doing nasty workarounds.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/1958002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47661 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 3c55d98111 Fix issue with svn copy/move directories.
svn diff would only generate a diff for modified files but the current code
would not respect full_move=True. full_move=True is necessary to make it work on
the try server.

TEST=svn move chrome chrome2; echo foo>>PRESUBMIT.py
The try job should fail but the diff should be right.
BUG=none

Review URL: http://codereview.chromium.org/1965001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@46566 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org fd87617b28 Standardize automatic retry and add a 15 seconds sleep to increase the chances of success
Review URL: http://codereview.chromium.org/1812001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@46067 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org a630bd7e2c Add a fallback to origin/trunk too when the branch is not tracked.
Raise an exception in case an upstream branch can't be found.
Fix an exception that was occuring just before when no upstream is found.

Review URL: http://codereview.chromium.org/1755018

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@46011 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 81e012ce41 Modify scm.GIT.GetUpstreamBranch to behave like git-cl.
It now defaults to origin/master when no branch is tracked.

TEST=git-try on untracked branch now doesn't result in an empty diff
BUG=none

Review URL: http://codereview.chromium.org/1739021

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@45935 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
sky@chromium.org 42d8da5831 Changes GetSVNBranch to prefer origin/HEAD over all others.
Review URL: http://codereview.chromium.org/1745009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@45468 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
tony@chromium.org 5756466130 Fix File() to work with SVN 1.4 by using svn export in place
of svn co --depth.

This should work even if you change svn versions between gclient syncs.
Review URL: http://codereview.chromium.org/1560029

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@44441 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
bauerb@chromium.org 838f0f28a5 Change |scm.GIT.GenerateDiff| and |scm.GIT.GetDifferentFiles| to ignore unmerged upstream changes.
Similar to r43313, this CL makes |git try| use the same patch that |git cl upload| uploads.

Review URL: http://codereview.chromium.org/1595018

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@44097 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
sky@chromium.org d8da2c1053 Changes GetSVNBranch to prefer the first ref over the last. The
scenario I encountered was I've added another one of my machines as a
remote, and because we preferred the last ref my diffs were always
against my remote machine rather than local trunk. This change prefers
the first over the last. Another option would be to prefer something
like remotes/origin/trunk. Let me know what you think.

I've got a similar change to git-cl, but I'll wait until we agree upon
this before uploading that one.

Review URL: http://codereview.chromium.org/1622011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@44094 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
bauerb@chromium.org 14ec50401c Change scm.GIT.CaptureStatus to ignore unmerged upstream changes.
With this CL, the patch that is sent to the code review site includes only changes from the nearest common ancestor of the local and the upstream branch.

A diagram:

     /----B <- local branch
----A-----C <- upstream

Previously, the diff would be simply between C and B, whereas now it's between A and C, even if you update C.

This allows you to continously update origin/trunk without having to rebase/merge your local changes all the time, resulting in the need for less rebuilds.

Review URL: http://codereview.chromium.org/1583003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@43113 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
nasser@codeaurora.org 5d63eb8382 revinfo: Properly use git HEAD or svn BASE revisions
BUG=http://crosbug.com/1658

Review URL: http://codereview.chromium.org/1307001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@42555 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 55e724e8fe Stop SVNWrapper and GitWrapper from inheriting from scm.SVN and scm.GIT.
This simplifies the unit tests and clarify what is what.

Ran pychecker on a few files.

Review URL: http://codereview.chromium.org/874002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@41310 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org d0f854af68 Extract git version check code from gclient_scm.py into scm.py where it belongs.
Review URL: http://codereview.chromium.org/878001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@41308 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 8599aa7da2 Fix failure to contain the line entry instead of constant "True"
TEST=none
BUG=34793

Review URL: http://codereview.chromium.org/591002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@38382 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 2de10250a2 Add automatic retry on HTTP 502 for svn and connection drop for git.
TEST=totally untested
BUG=34793

Review URL: http://codereview.chromium.org/574017

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@38336 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
nasser@codeaurora.org b65040abbf Fix a FetchUpstreamTuple cwd bug
in_directory was not being set to the correct cwd. This caused commands to
always run in the dir from which gclient was executed.

Review URL: http://codereview.chromium.org/554142

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37697 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
nasser@codeaurora.org cd968c1833 Always return a tuple from GIT.Capture
Review URL: http://codereview.chromium.org/555198

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37685 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 7be5ef2ed0 Change CheckCall behavior when print_error=False
We now return the stderr half of the tuple.
This required a clean up of any usage of CheckCall and GIT.Capture.

Patch contributed by Nasser Grainawi <nasser@codeaurora.org>

Review URL: http://codereview.chromium.org/551215

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37650 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 0836c56149 Fix svn mv/cp/ren diff for real this time, for try jobs.
TEST=send a try job with a file moved with modified content
BUG=6825

Review URL: http://codereview.chromium.org/554013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@36828 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org d6504218f2 Update docs for git usage
chromium-os BUG=1189

Review URL: http://codereview.chromium.org/551002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@36129 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 8ede00e1af Add the capability to filter out files on try job with regexp.
By default, filters out 'ChangeLog'. A pain directly coming from Webkit.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/543012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@36008 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org fd9cbbb7c4 Fix case sensitivity issues and svn move patches for --sub_rep on Windows.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/538009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35839 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 54d1f1ae2f Abort gclient sync when a svn command fails.
TEST=a svn locked directory will stop a gclient sync
BUG=none

Review URL: http://codereview.chromium.org/529002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35815 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 0c4016967e Fixed wrong argument placement.
TEST=none
BUG=none
TBR=bradnelson

Review URL: http://codereview.chromium.org/519073

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35688 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ce3c8621ea Style fix.
TEST=none
BUG=none

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35685 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 1c7db8e6ee Add "diff against" support when sending try patches.
This is mostly useful with git when diffing against arbitrary branches.

Review URL: http://codereview.chromium.org/524046

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