diff options
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/smartsync.py | 33 | ||||
-rw-r--r-- | subcmds/sync.py | 9 |
2 files changed, 38 insertions, 4 deletions
diff --git a/subcmds/smartsync.py b/subcmds/smartsync.py new file mode 100644 index 00000000..1edbd35b --- /dev/null +++ b/subcmds/smartsync.py | |||
@@ -0,0 +1,33 @@ | |||
1 | # | ||
2 | # Copyright (C) 2010 The Android Open Source Project | ||
3 | # | ||
4 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | # you may not use this file except in compliance with the License. | ||
6 | # You may obtain a copy of the License at | ||
7 | # | ||
8 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | # | ||
10 | # Unless required by applicable law or agreed to in writing, software | ||
11 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | # See the License for the specific language governing permissions and | ||
14 | # limitations under the License. | ||
15 | |||
16 | from sync import Sync | ||
17 | |||
18 | class Smartsync(Sync): | ||
19 | common = True | ||
20 | helpSummary = "Update working tree to the latest known good revision" | ||
21 | helpUsage = """ | ||
22 | %prog [<project>...] | ||
23 | """ | ||
24 | helpDescription = """ | ||
25 | The '%prog' command is a shortcut for sync -s. | ||
26 | """ | ||
27 | |||
28 | def _Options(self, p): | ||
29 | Sync._Options(self, p, show_smart=False) | ||
30 | |||
31 | def Execute(self, opt, args): | ||
32 | opt.smart_sync = True | ||
33 | Sync.Execute(self, opt, args) | ||
diff --git a/subcmds/sync.py b/subcmds/sync.py index 613cc81c..9b8a6122 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -94,7 +94,7 @@ later is required to fix a server side protocol bug. | |||
94 | 94 | ||
95 | """ | 95 | """ |
96 | 96 | ||
97 | def _Options(self, p): | 97 | def _Options(self, p, show_smart=True): |
98 | p.add_option('-l','--local-only', | 98 | p.add_option('-l','--local-only', |
99 | dest='local_only', action='store_true', | 99 | dest='local_only', action='store_true', |
100 | help="only update working tree, don't fetch") | 100 | help="only update working tree, don't fetch") |
@@ -104,9 +104,10 @@ later is required to fix a server side protocol bug. | |||
104 | p.add_option('-d','--detach', | 104 | p.add_option('-d','--detach', |
105 | dest='detach_head', action='store_true', | 105 | dest='detach_head', action='store_true', |
106 | help='detach projects back to manifest revision') | 106 | help='detach projects back to manifest revision') |
107 | p.add_option('-s', '--smart-sync', | 107 | if show_smart: |
108 | dest='smart_sync', action='store_true', | 108 | p.add_option('-s', '--smart-sync', |
109 | help='smart sync using manifest from a known good build') | 109 | dest='smart_sync', action='store_true', |
110 | help='smart sync using manifest from a known good build') | ||
110 | 111 | ||
111 | g = p.add_option_group('repo Version options') | 112 | g = p.add_option_group('repo Version options') |
112 | g.add_option('--no-repo-verify', | 113 | g.add_option('--no-repo-verify', |