summaryrefslogtreecommitdiffstats
path: root/src/fedpkg.py
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-06-24 22:38:32 -0700
committerJesse Keating <jkeating@redhat.com>2010-06-24 22:38:32 -0700
commit97f664b738a33ca60be09571f06030aa1a98fe6b (patch)
tree2770f25ddebcf28962aea54312a59a7fe9597245 /src/fedpkg.py
parent2da8c0160ca2078c1091a385cc0254e383505c88 (diff)
downloadfedora-packager-97f664b738a33ca60be09571f06030aa1a98fe6b.tar.gz
fedora-packager-97f664b738a33ca60be09571f06030aa1a98fe6b.tar.xz
fedora-packager-97f664b738a33ca60be09571f06030aa1a98fe6b.zip
Wire up the commit function into the frontend.
Diffstat (limited to 'src/fedpkg.py')
-rwxr-xr-xsrc/fedpkg.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py
index 6e12776..0a5b7b6 100755
--- a/src/fedpkg.py
+++ b/src/fedpkg.py
@@ -407,6 +407,17 @@ def clone(args):
else:
pyfedpkg.clone(args.module[0], args.user, args.path, args.branch)
+def commit(args):
+ try:
+ mymodule = pyfedpkg.PackageModule(args.path)
+ mymodule.commit(args.message, args.file, args.files)
+ except pyfedpkg.FedpkgError, e:
+ log.error('Could not commit: %s' % e)
+ sys.exit(1)
+ if args.push:
+ # do the push command here.
+ pass
+
def compile(args):
arch = None
short = False
@@ -690,6 +701,26 @@ packages will be built sequentially.
help = 'Name of the module to clone')
parser_clone.set_defaults(command = clone)
+ # commit stuff
+ parser_commit = subparsers.add_parser('commit',
+ help = 'Commit changes')
+ parser_commit.add_argument('-m', '--message',
+ default = None,
+ help = 'Use the given <msg> as the commit message.')
+ parser_commit.add_argument('-F', '--file',
+ default = None,
+ help = 'Take the commit message from the given file.')
+ # allow one to commit /and/ push at the same time.
+ parser_commit.add_argument('-p', '--push',
+ default = False,
+ action = 'store_true',
+ help = 'Commit and push as one action')
+ # Allow a list of files to be committed instead of everything
+ parser_commit.add_argument('files', nargs = '*',
+ default = [],
+ help = 'Optional list of specific files to commit')
+ parser_commit.set_defaults(command = commit)
+
# compile locally
parser_compile = subparsers.add_parser('compile',
help = 'Local test rpmbuild compile')