From: Zhang Qiang Date: Mon, 16 Jul 2012 02:12:56 +0000 (+0800) Subject: use --include-all to replace --include-uncommited X-Git-Tag: 0.8~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9d0e87f1032856132eb6a82a47c8be72d22adb6;p=tools%2Fgbs.git use --include-all to replace --include-uncommited --include-all is more reasonable and easy used by developer than --include-uncommited --- diff --git a/gitbuildsys/cmd_build.py b/gitbuildsys/cmd_build.py index 82ab376..6b511a4 100644 --- a/gitbuildsys/cmd_build.py +++ b/gitbuildsys/cmd_build.py @@ -233,9 +233,9 @@ def do(opts, args): if len(args) == 1: workdir = os.path.abspath(args[0]) - if opts.commit and opts.include_uncommited: + if opts.commit and opts.include_all: raise errors.Usage('--commit can\'t be specified together with '\ - '--include-uncommited') + '--include-all') try: repo = RpmGitRepository(workdir) @@ -249,16 +249,16 @@ def do(opts, args): if stat == '??': continue uncommitted_files.extend(status[stat]) - if not is_clean and not opts.include_uncommited: + if not is_clean and not opts.include_all: if untracked_files: msger.warning('the following untracked files would be not be '\ 'included:\n %s' % '\n '.join(untracked_files)) if uncommitted_files: msger.warning('the following uncommited changes would not be '\ 'included:\n %s' % '\n '.join(uncommitted_files)) - msger.warning('you can specify \'--include-uncommited\' option to '\ + msger.warning('you can specify \'--include-all\' option to '\ 'include these uncommited and untracked files.') - if opts.include_uncommited: + if opts.include_all: if untracked_files: msger.info('the following untracked files would be included' \ ':\n %s' % '\n '.join(untracked_files)) @@ -406,7 +406,7 @@ def do(opts, args): with utils.Workdir(workdir): if opts.commit: commit = opts.commit - elif opts.include_uncommited: + elif opts.include_all: commit = 'WC.UNTRACKED' else: commit = 'HEAD' diff --git a/gitbuildsys/cmd_export.py b/gitbuildsys/cmd_export.py index 5576a6c..e06fa4c 100644 --- a/gitbuildsys/cmd_export.py +++ b/gitbuildsys/cmd_export.py @@ -56,9 +56,9 @@ def do(opts, args): if len(args) == 1: workdir = os.path.abspath(args[0]) - if opts.commit and opts.include_uncommited: + if opts.commit and opts.include_all: raise errors.Usage('--commit can\'t be specified together with '\ - '--include-uncommited') + '--include-all') try: repo = RpmGitRepository(workdir) @@ -72,16 +72,16 @@ def do(opts, args): if stat == '??': continue uncommitted_files.extend(status[stat]) - if not is_clean and not opts.include_uncommited: + if not is_clean and not opts.include_all: if untracked_files: msger.warning('the following untracked files would be not be '\ 'included:\n %s' % '\n '.join(untracked_files)) if uncommitted_files: msger.warning('the following uncommited changes would not be '\ 'included:\n %s' % '\n '.join(uncommitted_files)) - msger.warning('you can specify \'--include-uncommited\' option to '\ + msger.warning('you can specify \'--include-all\' option to '\ 'include these uncommited and untracked files.') - if opts.include_uncommited: + if opts.include_all: if untracked_files: msger.info('the following untracked files would be included' \ ':\n %s' % '\n '.join(untracked_files)) @@ -111,7 +111,7 @@ def do(opts, args): with utils.Workdir(workdir): if opts.commit: commit = opts.commit - elif opts.include_uncommited: + elif opts.include_all: commit = 'WC.UNTRACKED' else: commit = 'HEAD' diff --git a/gitbuildsys/cmd_remotebuild.py b/gitbuildsys/cmd_remotebuild.py index 7a06b04..fa9bd90 100644 --- a/gitbuildsys/cmd_remotebuild.py +++ b/gitbuildsys/cmd_remotebuild.py @@ -75,9 +75,9 @@ def do(opts, args): msger.error('empty user is not allowed for remotebuild, '\ 'please add user/passwd to gbs conf, and try again') - if opts.commit and opts.include_uncommited: + if opts.commit and opts.include_all: raise errors.Usage('--commit can\'t be specified together with '\ - '--include-uncommited') + '--include-all') try: repo = repository.GitRepository(workdir) @@ -91,7 +91,7 @@ def do(opts, args): if stat == '??': continue uncommitted_files.extend(status[stat]) - if not is_clean and not opts.include_uncommited and not \ + if not is_clean and not opts.include_all and not \ (opts.buildlog or opts.status): if untracked_files: msger.warning('the following untracked files would be not be '\ @@ -99,9 +99,9 @@ def do(opts, args): if uncommitted_files: msger.warning('the following uncommited changes would not be '\ 'included:\n %s' % '\n '.join(uncommitted_files)) - msger.warning('you can specify \'--include-uncommited\' option to '\ + msger.warning('you can specify \'--include-all\' option to '\ 'include these uncommited and untracked files.') - if opts.include_uncommited and not (opts.buildlog or opts.status): + if opts.include_all and not (opts.buildlog or opts.status): if untracked_files: msger.info('the following untracked files would be included' \ ':\n %s' % '\n '.join(untracked_files)) @@ -215,7 +215,7 @@ def do(opts, args): with utils.Workdir(workdir): if opts.commit: commit = opts.commit - elif opts.include_uncommited: + elif opts.include_all: commit = 'WC.UNTRACKED' else: commit = 'HEAD' diff --git a/tools/gbs b/tools/gbs index 7e5cdfd..41641f9 100755 --- a/tools/gbs +++ b/tools/gbs @@ -128,12 +128,12 @@ class Gbs(cmdln.Cmdln): default=None, dest='commit', help='Specify a commit ID to export') - @cmdln.option('--include-uncommited', + @cmdln.option('--include-all', action='store_true', default=False, - dest='include_uncommited', - help='uncommited changes would be included while '\ - 'generating tar ball') + dest='include_all', + help='uncommited changes and untracked files would be '\ + 'included while generating tar ball') def do_export(self, _subcmd, opts, *args): """${cmd_name}: export files and prepare for build @@ -206,12 +206,12 @@ class Gbs(cmdln.Cmdln): dest='extra_packs', help='Specify extra packages to install to build root '\ 'multiple packages can be separated by comma') - @cmdln.option('--include-uncommited', + @cmdln.option('--include-all', action='store_true', default=False, - dest='include_uncommited', - help='uncommited changes would be included while '\ - 'generating tar ball') + dest='include_all', + help='uncommited changes and untracked files would be '\ + 'included while generating tar ball') @cmdln.option('--debuginfo', action='store_true', default=False, @@ -300,12 +300,12 @@ class Gbs(cmdln.Cmdln): default=False, dest='status', help='Get build status from build server') - @cmdln.option('--include-uncommited', + @cmdln.option('--include-all', action='store_true', default=False, - dest='include_uncommited', - help='uncommited changes would be included while '\ - 'generating tar ball') + dest='include_all', + help='uncommited changes and untracked files would be '\ + 'included while generating tar ball') def do_remotebuild(self, subcmd, opts, *args): """${cmd_name}: remote build package