diff --git a/project.py b/project.py index 1b0769a6..65fefd92 100644 --- a/project.py +++ b/project.py @@ -1670,8 +1670,10 @@ class Project(object): if GitCommand(self, cmd).Wait() != 0: raise GitError('%s rebase %s ' % (self.name, upstream)) - def _FastForward(self, head): + def _FastForward(self, head, ffonly=False): cmd = ['merge', head] + if ffonly: + cmd.append("--ff-only") if GitCommand(self, cmd).Wait() != 0: raise GitError('%s merge %s ' % (self.name, head)) diff --git a/subcmds/download.py b/subcmds/download.py index f79f485b..0ea45c3f 100644 --- a/subcmds/download.py +++ b/subcmds/download.py @@ -39,6 +39,9 @@ makes it available in your project's local working directory. p.add_option('-r','--revert', dest='revert', action='store_true', help="revert instead of checkout") + p.add_option('-f','--ff-only', + dest='ffonly', action='store_true', + help="force fast-forward merge") def _ParseChangeIds(self, args): if not args: @@ -87,5 +90,7 @@ makes it available in your project's local working directory. project._CherryPick(dl.commit) elif opt.revert: project._Revert(dl.commit) + elif opt.ffonly: + project._FastForward(dl.commit, ffonly=True) else: project._Checkout(dl.commit)