- print 'Pulling from "%s"...' % repository
- git.fetch(repository)
- if (config.get('stgit.pull-does-rebase') == 'yes'):
- print "rebasing to '%s'..." % crt_series.get_parent_branch()
- git.reset(tree_id = git.rev_parse(crt_series.get_parent_branch()))
- print 'done'
-
- # push the patches back
- if not options.nopush:
- push_patches(applied, options.merged)
+ if policy == 'pull':
+ print 'Pulling from "%s"...' % repository
+ git.pull(repository)
+ elif policy == 'fetch-rebase':
+ print 'Fetching from "%s"...' % repository
+ git.fetch(repository)
+ rebase(git.fetch_head())
+ elif policy == 'rebase':
+ rebase(crt_series.get_parent_branch())
+
+ post_rebase(applied, options.nopush, options.merged)