|
@@ -109,18 +109,28 @@ If no project is specified try to use current directory as a project.
|
|
|
file=sys.stderr)
|
|
file=sys.stderr)
|
|
|
for c in dl.commits:
|
|
for c in dl.commits:
|
|
|
print(' %s' % (c), file=sys.stderr)
|
|
print(' %s' % (c), file=sys.stderr)
|
|
|
- if opt.cherrypick:
|
|
|
|
|
- try:
|
|
|
|
|
- project._CherryPick(dl.commit, ffonly=opt.ffonly,
|
|
|
|
|
- record_origin=opt.record_origin)
|
|
|
|
|
- except GitError:
|
|
|
|
|
- print('[%s] Could not complete the cherry-pick of %s'
|
|
|
|
|
- % (project.name, dl.commit), file=sys.stderr)
|
|
|
|
|
- sys.exit(1)
|
|
|
|
|
|
|
|
|
|
|
|
+ if opt.cherrypick:
|
|
|
|
|
+ mode = 'cherry-pick'
|
|
|
elif opt.revert:
|
|
elif opt.revert:
|
|
|
- project._Revert(dl.commit)
|
|
|
|
|
|
|
+ mode = 'revert'
|
|
|
elif opt.ffonly:
|
|
elif opt.ffonly:
|
|
|
- project._FastForward(dl.commit, ffonly=True)
|
|
|
|
|
|
|
+ mode = 'fast-forward merge'
|
|
|
else:
|
|
else:
|
|
|
- project._Checkout(dl.commit)
|
|
|
|
|
|
|
+ mode = 'checkout'
|
|
|
|
|
+
|
|
|
|
|
+ try:
|
|
|
|
|
+ if opt.cherrypick:
|
|
|
|
|
+ project._CherryPick(dl.commit, ffonly=opt.ffonly,
|
|
|
|
|
+ record_origin=opt.record_origin)
|
|
|
|
|
+ elif opt.revert:
|
|
|
|
|
+ project._Revert(dl.commit)
|
|
|
|
|
+ elif opt.ffonly:
|
|
|
|
|
+ project._FastForward(dl.commit, ffonly=True)
|
|
|
|
|
+ else:
|
|
|
|
|
+ project._Checkout(dl.commit)
|
|
|
|
|
+
|
|
|
|
|
+ except GitError:
|
|
|
|
|
+ print('[%s] Could not complete the %s of %s'
|
|
|
|
|
+ % (project.name, mode, dl.commit), file=sys.stderr)
|
|
|
|
|
+ sys.exit(1)
|