Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Side by Side Diff: update_depot_tools

Issue 10784045: Fix update_depot_tools for git checkout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # This script will try to sync the bootstrap directories and then defer control. 6 # This script will try to sync the bootstrap directories and then defer control.
7 7
8 if [ "$USER" == "root" ]; 8 if [ "$USER" == "root" ];
9 then 9 then
10 echo Running depot tools as root is sad. 10 echo Running depot tools as root is sad.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 fi 63 fi
64 } 64 }
65 65
66 function is_git_clone_repo { 66 function is_git_clone_repo {
67 "$GIT" config remote.origin.fetch > /dev/null 67 "$GIT" config remote.origin.fetch > /dev/null
68 } 68 }
69 69
70 function update_git_repo { 70 function update_git_repo {
71 if is_git_clone_repo; then 71 if is_git_clone_repo; then
72 git fetch -q origin > /dev/null 72 git fetch -q origin > /dev/null
73 git rebase -q origin > /dev/null 73 git rebase -q origin/master > /dev/null
74 return 0 74 return 0
75 fi 75 fi
76 76
77 test_git_svn 77 test_git_svn
78 # work around a git-svn --quiet bug 78 # work around a git-svn --quiet bug
79 OUTPUT=`"$GIT" svn rebase -q -q` 79 OUTPUT=`"$GIT" svn rebase -q -q`
80 if [[ ! "$OUTPUT" == *Current.branch* ]]; then 80 if [[ ! "$OUTPUT" == *Current.branch* ]]; then
81 echo $OUTPUT 1>&2 81 echo $OUTPUT 1>&2
82 fi 82 fi
83 return 0 83 return 0
(...skipping 19 matching lines...) Expand all
103 # Update the root directory to stay up-to-date with the latest depot_tools. 103 # Update the root directory to stay up-to-date with the latest depot_tools.
104 BEFORE_REVISION=$(get_svn_revision) 104 BEFORE_REVISION=$(get_svn_revision)
105 "$SVN" -q up "$base_dir" 105 "$SVN" -q up "$base_dir"
106 AFTER_REVISION=$(get_svn_revision) 106 AFTER_REVISION=$(get_svn_revision)
107 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then 107 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then
108 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 108 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2
109 fi 109 fi
110 fi 110 fi
111 111
112 find "$base_dir" -iname "*.pyc" -exec rm {} \; 112 find "$base_dir" -iname "*.pyc" -exec rm {} \;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698