commit 74855e9cd8ab5ab6f296d55657412f1140387cd8 (HEAD -> master)
Author: Scott Moser <smoser@brickies.net>
Date: Fri Jan 13 11:53:03 2017 -0500
default to attempting to import patches applied and warn on fail.
Instead of --patches-applied now we always attempt patches applied.
If the --patches-applied-fatal flag is seen, then failure to apply
patches will result failure. Other wise, the error will just be
logged and the import will continue.
diff --git a/usd/importer.py b/usd/importer.py
index 73de6a6..5e236d8 100755
--- a/usd/importer.py
+++ b/usd/importer.py
@@ -87,9 +87,10 @@ class USDImport:
'Will create the local repository if needed.',
default=argparse.SUPPRESS
)
- parser.add_argument('--patches-applied', action='store_true',
- help='Also import patches-applied history '
- 'the specified source package')
+ parser.add_argument('--patches-applied-fatal', action='store_true',
+ help='Fail rather than warn if applying patches '
+ 'fails.',
+ default=False)
if not subparsers:
return parser.parse_args()
return 'import - %s' % kwargs['description']
@@ -827,9 +828,23 @@ class USDImport:
)
# only import patches-applied publishes if explicitly specified
- if not self.patches_applied:
- return
+ try:
+ self.commit_patches_applied(
+ spi, unapplied_import_tree_hash,
+ unapplied_publish_parent_commit,
+ unapplied_changelog_parent_commit,
+ upload_parent_commit)
+ except Exception as e:
+ if self.patches_applied_fatal:
+ raise
+ logging.error('Applying patches failed: %s', e)
+ return
+
+ def commit_patches_applied(self, spi, unapplied_import_tree_hash
+ unapplied_publish_parent_commit,
+ unapplied_changelog_parent_commit,
+ upload_parent_commit)
# Could also obtain this from the above
unapplied_parent_commit = str(self.local_repo.get_import_tag(spi.version).peel().id)
# Assume no patches to apply
@@ -885,7 +900,7 @@ class USDImport:
dl_cache = args.dl_cache
except AttributeError:
dl_cache = None
- self.patches_applied = args.patches_applied
+ self.patches_applied_fatal = args.patches_applied_fatal
print('Ubuntu Server Team importer v%s' % VERSION)