Fossil

Check-in [0c670599]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix up and simplify /ci page button generation code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | diff-eolws
Files: files | file ages | folders
SHA1:0c670599bff5c7080de3ce9e5b4ece1834650142
User & Date: joel 2014-03-05 00:20:19
Context
2014-03-05
00:42
Capitalize button labels for consistency with other pages. Change "Show Whitespace Differences" to "Show Whitespace Changes". check-in: 756c1875 user: joel tags: diff-eolws
00:20
Fix up and simplify /ci page button generation code. check-in: 0c670599 user: joel tags: diff-eolws
2014-03-04
14:14
Add "ignore whitespace" button to ci page. check-in: eb6935df user: jan.nijtmans tags: diff-eolws
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/info.c.

471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
...
665
666
667
668
669
670
671
672


673
674
675
676
677



678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727

    /* The "noopt" parameter disables diff optimization */
    if( PD("noopt",0)!=0 ) diffFlags |= DIFF_NOOPT;
  }
  return diffFlags;
}


/*
** WEBPAGE: vinfo
** WEBPAGE: ci
** URL:  /ci?name=RID|ARTIFACTID
**
** Display information about a particular check-in.
**
................................................................................
  }else{
    style_header("Check-in Information");
    login_anonymous_available();
  }
  db_finalize(&q1);
  showTags(rid, "");
  if( zParent ){
    const char *zW;


    @ <div class="section">Changes</div>
    @ <div class="sectionmenu">
    verboseFlag = g.zPath[0]!='c';
    if( db_get_boolean("show-version-diffs", 0)==0 ){
      verboseFlag = !verboseFlag;



      diffFlags = construct_diff_flags(verboseFlag, sideBySide);
      zW = (diffFlags&(DIFF_IGNORE_SOLWS|DIFF_IGNORE_EOLWS))?"&w":"";
      if( verboseFlag ){
        @ %z(xhref("class='button'","%R/vinfo/%T%s",zName,zW))
        @ hide&nbsp;diffs</a>
        if( sideBySide ){
          @ %z(xhref("class='button'","%R/ci/%T?sbs=0%s",zName,zW))
          @ unified&nbsp;diffs</a>
        }else{
          @ %z(xhref("class='button'","%R/ci/%T?sbs=1%s",zName,zW))
          @ side-by-side&nbsp;diffs</a>
        }
        if( *zW ){
          @ %z(xhref("class='button'","%R/ci/%T?sbs=%s",zName,sideBySide?"1":"0"))
          @ show&nbsp;whitespace&nbsp;differences</a>
        }else{
          @ %z(xhref("class='button'","%R/ci/%T?sbs=%s&w",zName,sideBySide?"1":"0"))
          @ ignore&nbsp;whitespace</a>
        }
      }else{
        @ %z(xhref("class='button'","%R/ci/%T?sbs=0%s",zName,zW))
        @ show&nbsp;unified&nbsp;diffs</a>
        @ %z(xhref("class='button'","%R/ci/%T?sbs=1%s",zName,zW))
        @ show&nbsp;side-by-side&nbsp;diffs</a>
      }
    }else{
      diffFlags = construct_diff_flags(verboseFlag, sideBySide);
      zW = (diffFlags&(DIFF_IGNORE_SOLWS|DIFF_IGNORE_EOLWS))?"&w":"";
      if( verboseFlag ){
        @ %z(xhref("class='button'","%R/ci/%T%s",zName,zW))hide&nbsp;diffs</a>
        if( sideBySide ){
          @ %z(xhref("class='button'","%R/info/%T?sbs=0",zName))
          @ unified&nbsp;diffs</a>
        }else{
          @ %z(xhref("class='button'","%R/info/%T?sbs=1",zName))
          @ side-by-side&nbsp;diffs</a>
        }
      }else{
        @ %z(xhref("class='button'","%R/vinfo/%T?sbs=0",zName))
        @ show&nbsp;unified&nbsp;diffs</a>
        @ %z(xhref("class='button'","%R/vinfo/%T?sbs=1",zName))
        @ show&nbsp;side-by-side&nbsp;diffs</a>
      }
    }
    @ %z(xhref("class='button'","%R/vpatch?from=%S&to=%S",zParent,zUuid))
    @ patch</a></div>
    if( pRe ){
      @ <p><b>Only differences that match regular expression "%h(zRe)"
      @ are shown.</b></p>
    }







<







 







|
>
>





>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
|
|
|
<







471
472
473
474
475
476
477

478
479
480
481
482
483
484
...
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701











702







703
704
705

706
707
708
709
710
711
712

    /* The "noopt" parameter disables diff optimization */
    if( PD("noopt",0)!=0 ) diffFlags |= DIFF_NOOPT;
  }
  return diffFlags;
}


/*
** WEBPAGE: vinfo
** WEBPAGE: ci
** URL:  /ci?name=RID|ARTIFACTID
**
** Display information about a particular check-in.
**
................................................................................
  }else{
    style_header("Check-in Information");
    login_anonymous_available();
  }
  db_finalize(&q1);
  showTags(rid, "");
  if( zParent ){
    const char *zW;               /* URL param for hiding whitespace */
    const char *zPage = "vinfo";  /* Page that shows diffs */
    const char *zPageHide = "ci"; /* Page that hides diffs */
    @ <div class="section">Changes</div>
    @ <div class="sectionmenu">
    verboseFlag = g.zPath[0]!='c';
    if( db_get_boolean("show-version-diffs", 0)==0 ){
      verboseFlag = !verboseFlag;
      zPage = "ci";
      zPageHide = "vinfo";
    }
    diffFlags = construct_diff_flags(verboseFlag, sideBySide);
    zW = (diffFlags&(DIFF_IGNORE_SOLWS|DIFF_IGNORE_EOLWS))?"&w":"";
    if( verboseFlag ){
      @ %z(xhref("class='button'","%R/%s/%T",zPageHide,zName))
      @ hide&nbsp;diffs</a>
      if( sideBySide ){
        @ %z(xhref("class='button'","%R/%s/%T?sbs=0%s",zPage,zName,zW))
        @ unified&nbsp;diffs</a>
      }else{
        @ %z(xhref("class='button'","%R/%s/%T?sbs=1%s",zPage,zName,zW))
        @ side-by-side&nbsp;diffs</a>
      }
      if( *zW ){
        @ %z(xhref("class='button'","%R/%s/%T?sbs=%d",zPage,zName,sideBySide))
        @ show&nbsp;whitespace&nbsp;differences</a>
      }else{
        @ %z(xhref("class='button'","%R/%s/%T?sbs=%d&w",zPage,zName,sideBySide))
        @ ignore&nbsp;whitespace</a>
      }
    }else{











      @ %z(xhref("class='button'","%R/%s/%T?sbs=0",zPage,zName))







      @ show&nbsp;unified&nbsp;diffs</a>
      @ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName))
      @ show&nbsp;side-by-side&nbsp;diffs</a>

    }
    @ %z(xhref("class='button'","%R/vpatch?from=%S&to=%S",zParent,zUuid))
    @ patch</a></div>
    if( pRe ){
      @ <p><b>Only differences that match regular expression "%h(zRe)"
      @ are shown.</b></p>
    }