summaryrefslogtreecommitdiffstats
path: root/src/fedpkg.py
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-07-01 16:34:36 -0700
committerJesse Keating <jkeating@redhat.com>2010-07-01 16:34:36 -0700
commit3e26ff00c6af7d598219a3fc806398424e3a973d (patch)
tree05e5a560028a7a15dd7ef23a2dcf30d12632d641 /src/fedpkg.py
parent498bec7e1dfa119c04136c34dadc52a8c9b53f2f (diff)
downloadfedora-packager-3e26ff00c6af7d598219a3fc806398424e3a973d.tar.gz
fedora-packager-3e26ff00c6af7d598219a3fc806398424e3a973d.tar.xz
fedora-packager-3e26ff00c6af7d598219a3fc806398424e3a973d.zip
Create a (simple) diff command
Diffstat (limited to 'src/fedpkg.py')
-rwxr-xr-xsrc/fedpkg.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py
index 0a5b7b6..5840c84 100755
--- a/src/fedpkg.py
+++ b/src/fedpkg.py
@@ -432,6 +432,14 @@ def compile(args):
log.error('Could not compile: %s' % e)
sys.exit(1)
+def diff(args):
+ try:
+ mymodule = pyfedpkg.PackageModule(args.path)
+ return mymodule.diff(args.cached, args.files)
+ except pyfedpkg.FedpkgError, e:
+ log.error('Could not diff: %s' % e)
+ sys.exit(1)
+
def export(args):
# not implimented; not planned
log.warning('Not implimented yet, got %s' % args)
@@ -734,6 +742,17 @@ packages will be built sequentially.
# help = 'Create a clean export')
#parser_export.set_defaults(command = export)
+ # diff, should work mostly like git diff
+ parser_diff = subparsers.add_parser('diff',
+ help = "Show changes between commits, commit and working tree, etc")
+ parser_diff.add_argument('--cached', default = False,
+ action = 'store_true',
+ help = 'View staged changes')
+ parser_diff.add_argument('files', nargs = '*',
+ default = [],
+ help = 'Optionally diff specific files')
+ parser_diff.set_defaults(command = diff)
+
# gimmespec takes an optional path argument, defaults to cwd
parser_gimmespec = subparsers.add_parser('gimmespec',
help = 'print spec file name')