Attachment 'wikiaction-2003-02-13.diff'

Download

   1 --- ../../moin/MoinMoin/wikiaction.py	Thu Feb 13 13:53:42 2003
   2 +++ wikiaction.py	Thu Feb 13 13:39:40 2003
   3 @@ -228,10 +228,9 @@
   4  
   5          return
   6  
   7 -    # call external diff command
   8 +    # calculate diff
   9      rc, page_file, backup_file, lines = wikiutil.pagediff(pagename, oldpagename, ignorews=ignorews)
  10  
  11 -    # check for valid diff
  12      if not lines:
  13          msg = _("<b>No differences found!</b>")
  14          if edit_count > 1:
  15 @@ -241,34 +240,28 @@
  16          if rc:
  17              msg = msg + '<p>' + _('The external diff utility returned with error code %(rc)s!') % locals()
  18          Page(pagename).send_page(request, msg=msg)
  19 -        return
  20  
  21 -    # send page title
  22 -    wikiutil.send_title(request, _('Diff for "%s"') % (pagename,), pagename=pagename)
  23 +    # using former fancy diff as simple 
  24 +    else:
  25 +        # send page title
  26 +        wikiutil.send_title(request, _('Diff for "%s"') % (pagename,), pagename=pagename)
  27  
  28 -    # options
  29 -    if not ignorews:
  30 -        qstr = 'action=diff&ignorews=1'
  31 -        if diff_date: qstr = '%s&date=%s' % (qstr, diff_date)
  32 -        print Page(pagename).link_to(
  33 -            text=_('Ignore changes in the amount of whitespace'),
  34 -            querystr=qstr), "<p>"
  35 -
  36 -    # Show date info
  37 -    print _('<b>Differences between version dated %s and %s') % (
  38 -        request.user.getFormattedDateTime(os.path.getmtime(backup_file)),
  39 -        request.user.getFormattedDateTime(os.path.getmtime(page_file)))
  40 -    if edit_count != 1:
  41 -        print _(' (spanning %d versions)') % (edit_count,)
  42 -    print '</b>'
  43 -
  44 -    # Remove header lines
  45 -    if lines[0][0:3] == "---":
  46 -        del lines[0]
  47 -    if lines[0][0:3] == "+++":
  48 -        del lines[0]
  49 +        # options
  50 +        if not ignorews:
  51 +            qstr = 'action=diff&ignorews=1'
  52 +            if diff_date: qstr = '%s&date=%s' % (qstr, diff_date)
  53 +            print Page(pagename).link_to(
  54 +                text=_('Ignore changes in the amount of whitespace'),
  55 +                querystr=qstr), "<p>"
  56 +
  57 +            # Show date info
  58 +            print _('<b>Differences between version dated %s and %s') % (
  59 +                request.user.getFormattedDateTime(os.path.getmtime(backup_file)),
  60 +                request.user.getFormattedDateTime(os.path.getmtime(page_file)))
  61 +            if edit_count != 1:
  62 +                print _(' (spanning %d versions)') % (edit_count,)
  63 +            print '</b>'
  64  
  65 -    if request.user.show_fancy_diff:
  66          print '<div class="diff-removed">' + _('Deletions are marked like this.') + '</div>'
  67          print '<div class="diff-added">' + _('Additions are marked like this.') + '</div>'
  68  
  69 @@ -295,16 +288,8 @@
  70                  print '<div class="diff-removed">%s</div>' % (line,)
  71              else:
  72                  print '<div>%s</div>' % (line,)
  73 -    else:
  74 -        print '<pre>'
  75 -        for line in lines:
  76 -            marker = line[0]
  77 -            if marker == "@":
  78 -                print '<hr>'
  79 -            request.write(cgi.escape(line))
  80 -        print '</pre>'
  81  
  82 -    wikiutil.send_footer(request, pagename, showpage=1)
  83 +        wikiutil.send_footer(request, pagename, showpage=1)
  84  
  85  
  86  def do_info(pagename, request):

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2003-12-31 09:44:19, 6.2 KB) [[attachment:fix-attachfile-filename.diff]]
  • [get | view] (2004-01-04 08:55:32, 0.6 KB) [[attachment:fix-twisted-httphost.diff]]
  • [get | view] (2004-01-16 08:39:21, 1.6 KB) [[attachment:macro-sendpage.diff]]
  • [get | view] (2003-12-31 09:20:52, 7.0 KB) [[attachment:raise-but-exit.diff]]
  • [get | view] (2003-12-07 18:15:55, 0.2 KB) [[attachment:version.txt]]
  • [get | view] (2003-12-07 18:15:55, 3.1 KB) [[attachment:wikiaction-2003-02-13.diff]]
  • [get | view] (2003-12-07 18:15:55, 3.2 KB) [[attachment:wikiutil-2003-02-13.diff]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.