[Moin-devel] CVS: MoinMoin wikiaction.py,1.49,1.50 wikiutil.py,1.68,1.69

J?rgen Hermann jhermann at users.sourceforge.net
Wed Jan 23 13:49:21 EST 2002


Update of /cvsroot/moin/MoinMoin
In directory usw-pr-cvs1:/tmp/cvs-serv13071/MoinMoin

Modified Files:
	wikiaction.py wikiutil.py 
Log Message:
Additional link on diff pages to ignore whitespace changes


Index: wikiaction.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -r1.49 -r1.50
*** wikiaction.py	2002/01/21 21:38:11	1.49
--- wikiaction.py	2002/01/23 21:48:31	1.50
***************
*** 148,151 ****
--- 148,157 ----
          diff_date = None
  
+     # spacing flag?
+     try:
+         ignorews = int(form['ignorews'].value)
+     except (KeyError, ValueError, TypeError):
+         ignorews = 0
+ 
      # get a list of old revisions, and back out if none are available
      oldversions = wikiutil.getBackupList(config.backup_dir, pagename)
***************
*** 170,174 ****
          oldpage = oldversions[0]
  
!     page_file, backup_file, lines = wikiutil.pagediff(pagename, oldpage)
  
      # check for valid diff
--- 176,180 ----
          oldpage = oldversions[0]
  
!     page_file, backup_file, lines = wikiutil.pagediff(pagename, oldpage, ignorews=ignorews)
  
      # check for valid diff
***************
*** 184,187 ****
--- 190,201 ----
      # send page title
      wikiutil.send_title(_('Diff for "%s"') % (pagename,), pagename=pagename)
+ 
+     # options
+     if not ignorews:
+         qstr = 'action=diff&ignorews=1'
+         if diff_date: qstr = '%s&date=%s' % (qstr, diff_date)
+         print Page(pagename).link_to(
+             text=_('Ignore changes in the amount of whitespace'),
+             querystr=qstr), "<p>"
  
      # Show date info

Index: wikiutil.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/wikiutil.py,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -r1.68 -r1.69
*** wikiutil.py	2002/01/22 20:10:08	1.68
--- wikiutil.py	2002/01/23 21:48:32	1.69
***************
*** 355,364 ****
  
  
! def pagediff(pagename, oldpage):
      # build the diff command and execute it
      backup_file = os.path.join(config.backup_dir, oldpage)
      page_file = os.path.join(config.text_dir, quoteFilename(pagename))
!     cmd = "%(diff)s -u %(backup)s %(page)s" % {
          "diff": config.external_diff,
          "backup": backup_file,
          "page": page_file,
--- 355,367 ----
  
  
! def pagediff(pagename, oldpage, **kw):
      # build the diff command and execute it
      backup_file = os.path.join(config.backup_dir, oldpage)
      page_file = os.path.join(config.text_dir, quoteFilename(pagename))
!     options = '-u'
!     if kw.get('ignorews', 0): options = options + ' -b'
!     cmd = "%(diff)s %(options)s %(backup)s %(page)s" % {
          "diff": config.external_diff,
+         "options": options,
          "backup": backup_file,
          "page": page_file,





More information about the Moin-devel mailing list