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

Side by Side Diff: git-crup

Issue 10830108: Fix handling of optional argument to -j. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 4 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 #!/bin/sh 1 #!/bin/sh
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 # A convenience script to largely replicate the behavior of `gclient sync` in a 6 # A convenience script to largely replicate the behavior of `gclient sync` in a
7 # submodule-based checkout. Fetches latest commits for top-level solutions; 7 # submodule-based checkout. Fetches latest commits for top-level solutions;
8 # updates submodules; and runs post-sync hooks. 8 # updates submodules; and runs post-sync hooks.
9 9
10 j=10 10 j=10
(...skipping 24 matching lines...) Expand all
35 git ls-files -s | grep ^160000 | awk '{print $4}' | 35 git ls-files -s | grep ^160000 | awk '{print $4}' |
36 xargs $max_lines -P "$j" $ECHO git submodule update --init 36 xargs $max_lines -P "$j" $ECHO git submodule update --init
37 else 37 else
38 echo "Warn: parallel execution is not supported on this platform." 38 echo "Warn: parallel execution is not supported on this platform."
39 $ECHO git submodule update --init 39 $ECHO git submodule update --init
40 fi ) 40 fi )
41 } 41 }
42 42
43 while test $# -ne 0; do 43 while test $# -ne 0; do
44 case "$1" in 44 case "$1" in
45 -j[0-9]*)
46 j=$(echo "$1" | cut -c3-)
47 ;;
48 --jobs=[0-9]*)
49 j=$(echo "$1" | cut -c8-)
50 ;;
cmp 2012/08/02 17:21:53 increase indent on lines 49-50 by 1 space
szager 2012/08/02 17:23:50 Done.
45 -j|--jobs) 51 -j|--jobs)
46 if test -n "$2"; then 52 case "$2" in
47 j="$2" 53 ''|-*)
48 shift 54 j=0
49 else 55 ;;
50 j=0 56 *)
51 fi 57 j="$2"
58 shift
59 ;;
60 esac
52 ;; 61 ;;
53 -n|--dry-run) 62 -n|--dry-run)
54 ECHO=echo 63 ECHO=echo
55 ;; 64 ;;
56 -h|--help) 65 -h|--help)
57 usage 66 usage
58 exit 0 67 exit 0
59 ;; 68 ;;
60 --fetch) 69 --fetch)
61 pull=fetch 70 pull=fetch
(...skipping 20 matching lines...) Expand all
82 exit 1 91 exit 1
83 fi 92 fi
84 93
85 ls -d */.git | 94 ls -d */.git |
86 while read gitdir; do 95 while read gitdir; do
87 parallel_update `dirname $gitdir` 96 parallel_update `dirname $gitdir`
88 done 97 done
89 98
90 gclient_spec="solutions=[{'name':'src','url':None,'deps_file':'.DEPS.git'}]" 99 gclient_spec="solutions=[{'name':'src','url':None,'deps_file':'.DEPS.git'}]"
91 test "$hooks" = "yes" && gclient runhooks --spec="$gclient_spec" 100 test "$hooks" = "yes" && gclient runhooks --spec="$gclient_spec"
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