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

Unified Diff: update_depot_tools

Issue 11742032: For git checkouts of depot_tools, update remote.origin.url to the git-on-borg mirror. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools@master
Patch Set: Add newline Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_depot_tools
diff --git a/update_depot_tools b/update_depot_tools
index 3ad917a8fdafa34dd7da1628d219185a64c2fe81..61924d1285a855ccee0f0d5eebef721b5ed312c1 100755
--- a/update_depot_tools
+++ b/update_depot_tools
@@ -22,6 +22,8 @@ fi
OUTPUT="$(uname | grep 'MINGW')"
MINGW=$?
+CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools"
M-A Ruel 2013/01/07 16:19:18 Wouldn't it be better to use ".../depot_tools.git"
+
SVN="svn"
if [ -d "$base_dir/svn_bin" -a $MINGW = 0 ]; then
SVN="$base_dir/svn_bin/svn.exe"
@@ -70,6 +72,22 @@ function is_git_clone_repo {
}
function update_git_repo {
+ remote_url=$("$GIT" config --get remote.origin.url)
+ if [ -n "$remote_url" -a "$remote_url" != "$CANONICAL_GIT_URL" ]; then
+ echo "Your copy of depot_tools is configured to fetch from an obsolete URL:"
+ echo
+ echo " $remote_url"
+ echo
+ read -t 60 -p "OK to update it to $CANONICAL_GIT_URL ? [Y/n] " -n 1
+ echo
+ if [ $? -ne "0" ]; then
+ echo "Timeout; not updating remote URL."
+ elif [ -z "$REPLY" -o "$REPLY" = "Y" -o "$REPLY" = "y" ]; then
+ "$GIT" config remote.origin.url "$CANONICAL_GIT_URL"
+ echo "Remote URL updated."
+ fi
+ fi
+
if is_git_clone_repo; then
git fetch -q origin &> /dev/null
local REBASE_TXT STATUS
« 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