mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Smart tag support
This is an evolution of 'smart-sync' that adds a new option, -t, that allows you to specify a tag/label to use instead of the "latest good build" on the current manifest branch which -s does. Signed-off-by: Victor Boivie <victor.boivie@sonyericsson.com> Change-Id: I8c20fd91104a6aafa0271d4d33f6c4850aade17e
This commit is contained in:
parent
a101f1c167
commit
08c880db18
@ -72,7 +72,8 @@ revision is temporarily needed.
|
|||||||
|
|
||||||
The -s/--smart-sync option can be used to sync to a known good
|
The -s/--smart-sync option can be used to sync to a known good
|
||||||
build as specified by the manifest-server element in the current
|
build as specified by the manifest-server element in the current
|
||||||
manifest.
|
manifest. The -t/--smart-tag option is similar and allows you to
|
||||||
|
specify a custom tag/label.
|
||||||
|
|
||||||
The -f/--force-broken option can be used to proceed with syncing
|
The -f/--force-broken option can be used to proceed with syncing
|
||||||
other projects if a project sync fails.
|
other projects if a project sync fails.
|
||||||
@ -130,6 +131,9 @@ later is required to fix a server side protocol bug.
|
|||||||
p.add_option('-s', '--smart-sync',
|
p.add_option('-s', '--smart-sync',
|
||||||
dest='smart_sync', action='store_true',
|
dest='smart_sync', action='store_true',
|
||||||
help='smart sync using manifest from a known good build')
|
help='smart sync using manifest from a known good build')
|
||||||
|
p.add_option('-t', '--smart-tag',
|
||||||
|
dest='smart_tag', action='store',
|
||||||
|
help='smart sync using manifest from a known tag')
|
||||||
|
|
||||||
g = p.add_option_group('repo Version options')
|
g = p.add_option_group('repo Version options')
|
||||||
g.add_option('--no-repo-verify',
|
g.add_option('--no-repo-verify',
|
||||||
@ -315,27 +319,31 @@ uncommitted changes are present' % project.relpath
|
|||||||
print >>sys.stderr, 'error: cannot combine -n and -l'
|
print >>sys.stderr, 'error: cannot combine -n and -l'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if opt.smart_sync:
|
if opt.smart_sync or opt.smart_tag:
|
||||||
if not self.manifest.manifest_server:
|
if not self.manifest.manifest_server:
|
||||||
print >>sys.stderr, \
|
print >>sys.stderr, \
|
||||||
'error: cannot smart sync: no manifest server defined in manifest'
|
'error: cannot smart sync: no manifest server defined in manifest'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
try:
|
try:
|
||||||
server = xmlrpclib.Server(self.manifest.manifest_server)
|
server = xmlrpclib.Server(self.manifest.manifest_server)
|
||||||
p = self.manifest.manifestProject
|
if opt.smart_sync:
|
||||||
b = p.GetBranch(p.CurrentBranch)
|
p = self.manifest.manifestProject
|
||||||
branch = b.merge
|
b = p.GetBranch(p.CurrentBranch)
|
||||||
if branch.startswith(R_HEADS):
|
branch = b.merge
|
||||||
branch = branch[len(R_HEADS):]
|
if branch.startswith(R_HEADS):
|
||||||
|
branch = branch[len(R_HEADS):]
|
||||||
|
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
if (env.has_key('TARGET_PRODUCT') and
|
if (env.has_key('TARGET_PRODUCT') and
|
||||||
env.has_key('TARGET_BUILD_VARIANT')):
|
env.has_key('TARGET_BUILD_VARIANT')):
|
||||||
target = '%s-%s' % (env['TARGET_PRODUCT'],
|
target = '%s-%s' % (env['TARGET_PRODUCT'],
|
||||||
env['TARGET_BUILD_VARIANT'])
|
env['TARGET_BUILD_VARIANT'])
|
||||||
[success, manifest_str] = server.GetApprovedManifest(branch, target)
|
[success, manifest_str] = server.GetApprovedManifest(branch, target)
|
||||||
|
else:
|
||||||
|
[success, manifest_str] = server.GetApprovedManifest(branch)
|
||||||
else:
|
else:
|
||||||
[success, manifest_str] = server.GetApprovedManifest(branch)
|
assert(opt.smart_tag)
|
||||||
|
[success, manifest_str] = server.GetManifest(opt.smart_tag)
|
||||||
|
|
||||||
if success:
|
if success:
|
||||||
manifest_name = "smart_sync_override.xml"
|
manifest_name = "smart_sync_override.xml"
|
||||||
|
Loading…
Reference in New Issue
Block a user