import sys, os, re
from stgit.utils import *
+from stgit.out import *
from stgit import git, basedir, templates
from stgit.config import config
from shutil import copyfile
if show_patch:
print >> f, __patch_prefix
# series.get_patch(series.get_current()).get_top()
- git.diff([], series.get_patch(series.get_current()).get_bottom(), None, f)
+ diff_str = git.diff(rev1 = series.get_patch(series.get_current()).get_bottom())
+ f.write(diff_str)
#Vim modeline must be near the end.
print >> f, __comment_prefix, 'vi: set textwidth=75 filetype=diff nobackup:'
out.note(('No parent remote declared for stack "%s",'
' defaulting to "origin".' % self.get_name()),
('Consider setting "branch.%s.remote" and'
- ' "branch.%s.merge" with "git repo-config".'
+ ' "branch.%s.merge" with "git config".'
% (self.get_name(), self.get_name())))
return 'origin'
else:
out.note(('No parent branch declared for stack "%s",'
' defaulting to "heads/origin".' % self.get_name()),
('Consider setting "branch.%s.stgit.parentbranch"'
- ' with "git repo-config".' % self.get_name()))
+ ' with "git config".' % self.get_name()))
return 'heads/origin'
else:
raise StackException, 'Cannot find a parent branch for "%s"' % self.get_name()
def set_parent(self, remote, localbranch):
if localbranch:
- self.__set_parent_remote(remote)
+ if remote:
+ self.__set_parent_remote(remote)
self.__set_parent_branch(localbranch)
# We'll enforce this later
# else:
if not committer_email:
committer_email = patch.get_commemail()
- if sign_str:
- descr = descr.rstrip()
- if descr.find("\nSigned-off-by:") < 0 \
- and descr.find("\nAcked-by:") < 0:
- descr = descr + "\n"
-
- descr = '%s\n%s: %s <%s>\n' % (descr, sign_str,
- committer_name, committer_email)
+ descr = add_sign_line(descr, sign_str, committer_name, committer_email)
bottom = patch.get_bottom()