Don't have a global crt_series in stgit.commans.common
[stgit] / stgit / commands / mail.py
index 4a4158a..883a4f3 100644 (file)
@@ -350,8 +350,8 @@ def __build_cover(tmpl, patches, msg_id, options):
                  'shortlog':     stack.shortlog(crt_series.get_patch(p)
                                                 for p in patches),
                  'diffstat':     git.diffstat(
-                                     rev1 = git_id('%s//bottom' % patches[0]),
-                                     rev2 = git_id('%s//top' % patches[-1]))}
+                     rev1 = git_id(crt_series, '%s//bottom' % patches[0]),
+                     rev2 = git_id(crt_series, '%s//top' % patches[-1]))}
 
     try:
         msg_string = tmpl % tmpl_dict
@@ -435,11 +435,13 @@ def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):
                  'longdescr':    long_descr,
                  # for backward template compatibility
                  'endofheaders': '',
-                 'diff':         git.diff(rev1 = git_id('%s//bottom' % patch),
-                                          rev2 = git_id('%s//top' % patch),
-                                          diff_flags = diff_flags ),
-                 'diffstat':     git.diffstat(rev1 = git_id('%s//bottom'%patch),
-                                              rev2 = git_id('%s//top' % patch)),
+                 'diff':         git.diff(
+                     rev1 = git_id(crt_series, '%s//bottom' % patch),
+                     rev2 = git_id(crt_series, '%s//top' % patch),
+                     diff_flags = diff_flags),
+                 'diffstat':     git.diffstat(
+                     rev1 = git_id(crt_series, '%s//bottom'%patch),
+                     rev2 = git_id(crt_series, '%s//top' % patch)),
                  # for backward template compatibility
                  'date':         '',
                  'version':      version_str,