VersionDiffBrowser.st
changeset 11961 094f448dc1f0
parent 11958 949cbf2cbeb2
child 11962 1d931eea22af
equal deleted inserted replaced
11960:5cccb9f811d0 11961:094f448dc1f0
   739     ^ theBrowser.
   739     ^ theBrowser.
   740 !
   740 !
   741 
   741 
   742 openOnDiffSet:diffSet labelA:aLabelA labelB:aLabelB title:ignoredTitle
   742 openOnDiffSet:diffSet labelA:aLabelA labelB:aLabelB title:ignoredTitle
   743     ^ self
   743     ^ self
   744 	openOnDiffSet:diffSet labelA:aLabelA labelB:aLabelB title:ignoredTitle
   744         openOnDiffSet:diffSet 
   745 	ignoreExtensions:false
   745         labelA:aLabelA labelB:aLabelB 
       
   746         title:ignoredTitle
       
   747         ignoreExtensions:false
       
   748         ignoreVersionMethods:false
   746 
   749 
   747     "Modified: / 12-09-2011 / 11:52:44 / cg"
   750     "Modified: / 12-09-2011 / 11:52:44 / cg"
   748 !
   751 !
   749 
   752 
   750 openOnDiffSet:diffSet labelA:aLabelA labelB:aLabelB title:ignoredTitle ignoreExtensions:aBoolean
   753 openOnDiffSet:diffSet labelA:aLabelA labelB:aLabelB title:ignoredTitle ignoreExtensions:ignoreExtensionsBoolean
       
   754     ^ self
       
   755         openOnDiffSet:diffSet 
       
   756         labelA:aLabelA labelB:aLabelB 
       
   757         title:ignoredTitle 
       
   758         ignoreExtensions:ignoreExtensionsBoolean 
       
   759         ignoreVersionMethods:false
       
   760 !
       
   761 
       
   762 openOnDiffSet:diffSet labelA:aLabelA labelB:aLabelB title:ignoredTitle ignoreExtensions:ignoreExtensionsBoolean ignoreVersionMethods:ignoreVersionMethodsBoolean
   751     |theBrowser|
   763     |theBrowser|
   752 
   764 
   753     theBrowser := self new.
   765     theBrowser := self new.
   754     theBrowser ignoreExtensions:aBoolean.
   766     theBrowser ignoreExtensions:ignoreExtensionsBoolean.
       
   767     theBrowser ignoreVersionMethods:ignoreVersionMethodsBoolean.
   755     theBrowser allButOpen.
   768     theBrowser allButOpen.
   756     theBrowser setupForDiffSet:diffSet labelA:aLabelA labelB:aLabelB.
   769     theBrowser setupForDiffSet:diffSet labelA:aLabelA labelB:aLabelB.
   757     theBrowser window label:ignoredTitle.
   770     theBrowser window label:ignoredTitle.
   758     theBrowser openWindow.
   771     theBrowser openWindow.
   759     ^ theBrowser.
   772     ^ theBrowser.
   858      Ignoring is useful when comparing for baseClass checkin,
   871      Ignoring is useful when comparing for baseClass checkin,
   859      as opposed to extension-checking, where extensions should not be ignored.
   872      as opposed to extension-checking, where extensions should not be ignored.
   860      the default is false"
   873      the default is false"
   861 
   874 
   862     self includeExtensions:aBoolean not
   875     self includeExtensions:aBoolean not
       
   876 
       
   877     "Modified: / 06-03-2012 / 15:37:32 / cg"
       
   878 !
       
   879 
       
   880 ignoreVersionMethods:aBoolean
       
   881     "if true, version methods (version and version_XXX) are suppressed.
       
   882      Ignoring is useful when comparing for real code changes.
       
   883      the default is false"
       
   884 
       
   885     self includeVersionMethods:aBoolean not
   863 
   886 
   864     "Modified: / 06-03-2012 / 15:37:32 / cg"
   887     "Modified: / 06-03-2012 / 15:37:32 / cg"
   865 !
   888 !
   866 
   889 
   867 selectedChangeInA
   890 selectedChangeInA
  1872 !
  1895 !
  1873 
  1896 
  1874 updateLists
  1897 updateLists
  1875     |classChangeSet listOnlyInA listOnlyInB listChanged
  1898     |classChangeSet listOnlyInA listOnlyInB listChanged
  1876      printStringGenerator sortBlockForChangeLists filteredList
  1899      printStringGenerator sortBlockForChangeLists filteredList
  1877      isIgnoredChange numIgnoredExtensions|
  1900      isIgnoredChange numIgnoredExtensions numIgnoredVersionMethods 
       
  1901      info needFilter|
  1878 
  1902 
  1879     classChangeSet := self classChangeSet.
  1903     classChangeSet := self classChangeSet.
  1880 
  1904 
  1881     printStringGenerator := [:aChange | self printStringForChange:aChange].
  1905     printStringGenerator := [:aChange | self printStringForChange:aChange].
  1882     sortBlockForChangeLists := [:a :b | (printStringGenerator value:a) < (printStringGenerator value:b)].
  1906     sortBlockForChangeLists := [:a :b | (printStringGenerator value:a) < (printStringGenerator value:b)].
  1883 
  1907 
  1884     numIgnoredExtensions := 0.
  1908     numIgnoredExtensions := numIgnoredVersionMethods := 0.
       
  1909     needFilter := self includeExtensions not 
       
  1910                   or:[self includeCategoryChanges not
       
  1911                   or:[self includeVersionMethods not]].
  1885 
  1912 
  1886     isIgnoredChange :=
  1913     isIgnoredChange :=
  1887         [:change |
  1914         [:change |
  1888             |packageOfMethodInChange packageOfMethodInImage changeMethod ignored|
  1915             |packageOfMethodInChange packageOfMethodInImage changeMethod ignored|
  1889 
  1916 
  1890             ignored := false.
  1917             ignored := false.
  1891             (change isMethodCodeChange and:[ self includeExtensions not ]) ifTrue:[
  1918             change isMethodCodeChange ifTrue:[
  1892                 packageOfMethodInChange := change package.
  1919                 self includeExtensions ifFalse:[
  1893                 (packageOfMethodInChange notNil
  1920                     packageOfMethodInChange := change package.
  1894                   and:[ packageOfMethodInChange ~= PackageId noProjectID
  1921                     (packageOfMethodInChange notNil
  1895                   and:[ packageOfMethodInChange ~= change changeClass package ]]) ifTrue:[
  1922                       and:[ packageOfMethodInChange ~= PackageId noProjectID
  1896                     ignored := true
  1923                       and:[ packageOfMethodInChange ~= change changeClass package ]]) ifTrue:[
  1897                 ].
       
  1898 
       
  1899                 changeMethod := change changeMethod.
       
  1900                 changeMethod notNil ifTrue:[
       
  1901                     packageOfMethodInImage := changeMethod package.
       
  1902                     (true "packageOfMethodInImage notNil"
       
  1903                       and:[ packageOfMethodInImage ~= PackageId noProjectID
       
  1904                       and:[ packageOfMethodInImage ~= changeMethod mclass package ]]) ifTrue:[
       
  1905                         ignored := true
  1924                         ignored := true
  1906                     ].
  1925                     ].
       
  1926 
       
  1927                     changeMethod := change changeMethod.
       
  1928                     changeMethod notNil ifTrue:[
       
  1929                         packageOfMethodInImage := changeMethod package.
       
  1930                         (true "packageOfMethodInImage notNil"
       
  1931                           and:[ packageOfMethodInImage ~= PackageId noProjectID
       
  1932                           and:[ packageOfMethodInImage ~= changeMethod mclass package ]]) ifTrue:[
       
  1933                             ignored := true
       
  1934                         ].
       
  1935                     ].
       
  1936                     numIgnoredExtensions := numIgnoredExtensions + (ignored ifTrue:[1] ifFalse:[0]).
  1907                 ].
  1937                 ].
  1908                 numIgnoredExtensions := numIgnoredExtensions + (ignored ifTrue:[1] ifFalse:[0]).
  1938                 self includeVersionMethods ifFalse:[
       
  1939                     (change isMethodChangeForVersionMethod
       
  1940                     or:[ change isMethodChangeForExtensionsVersionMethod ]) ifTrue:[
       
  1941                         ignored := true.
       
  1942                         numIgnoredVersionMethods := numIgnoredVersionMethods + 1
       
  1943                     ].
       
  1944                 ].
  1909             ] ifFalse:[
  1945             ] ifFalse:[
  1910                 (change isMethodCategoryChange and:[self includeCategoryChanges not]) ifTrue:[
  1946                 change isMethodCategoryChange ifTrue:[
  1911                     ignored := true
  1947                     self includeCategoryChanges ifFalse:[
       
  1948                         ignored := true
       
  1949                     ]
  1912                 ].
  1950                 ].
  1913             ].
  1951             ].
  1914             ignored.
  1952             ignored.
  1915         ].
  1953         ].
  1916 
  1954 
  1917     listOnlyInA := filteredList := self methodsOnlyInA.
  1955     listOnlyInA := filteredList := self methodsOnlyInA.
  1918     listOnlyInA removeAll.
  1956     listOnlyInA removeAll.
  1919     classChangeSet notNil ifTrue:[
  1957     classChangeSet notNil ifTrue:[
  1920         "/ classChangeSet methodsOnlyInA sort:sortBlockForChangeLists.
  1958         "/ classChangeSet methodsOnlyInA sort:sortBlockForChangeLists.
  1921         filteredList := classChangeSet methodsOnlyInA.
  1959         filteredList := classChangeSet methodsOnlyInA.
  1922         (self includeExtensions not or:[self includeCategoryChanges not]) ifTrue:[
  1960         needFilter ifTrue:[
  1923             filteredList := filteredList reject:isIgnoredChange.
  1961             filteredList := filteredList reject:isIgnoredChange.
  1924         ].
  1962         ].
  1925         listOnlyInA addAll: (filteredList collect:printStringGenerator).
  1963         listOnlyInA addAll: (filteredList collect:printStringGenerator).
  1926     ].
  1964     ].
  1927     methodsOnlyInAFiltered := filteredList.
  1965     methodsOnlyInAFiltered := filteredList.
  1929     listOnlyInB := filteredList := self methodsOnlyInB.
  1967     listOnlyInB := filteredList := self methodsOnlyInB.
  1930     listOnlyInB removeAll.
  1968     listOnlyInB removeAll.
  1931     classChangeSet notNil ifTrue:[
  1969     classChangeSet notNil ifTrue:[
  1932         "/ classChangeSet methodsOnlyInB sort:sortBlockForChangeLists.
  1970         "/ classChangeSet methodsOnlyInB sort:sortBlockForChangeLists.
  1933         filteredList := classChangeSet methodsOnlyInB.
  1971         filteredList := classChangeSet methodsOnlyInB.
  1934         (self includeExtensions not or:[self includeCategoryChanges not]) ifTrue:[
  1972         needFilter ifTrue:[
  1935             filteredList := filteredList reject:isIgnoredChange.
  1973             filteredList := filteredList reject:isIgnoredChange.
  1936         ].
  1974         ].
  1937         listOnlyInB addAll: (filteredList collect:printStringGenerator).
  1975         listOnlyInB addAll: (filteredList collect:printStringGenerator).
  1938     ].
  1976     ].
  1939     methodsOnlyInBFiltered := filteredList.
  1977     methodsOnlyInBFiltered := filteredList.
  1941     listChanged := filteredList := self methodsChanged.
  1979     listChanged := filteredList := self methodsChanged.
  1942     listChanged removeAll.
  1980     listChanged removeAll.
  1943     classChangeSet notNil ifTrue:[
  1981     classChangeSet notNil ifTrue:[
  1944         "/ classChangeSet methodsChanged sort:[:a :b | sortBlockForChangeLists value:a first value:b first].
  1982         "/ classChangeSet methodsChanged sort:[:a :b | sortBlockForChangeLists value:a first value:b first].
  1945         filteredList := classChangeSet methodsChanged.
  1983         filteredList := classChangeSet methodsChanged.
  1946         (self includeExtensions not or:[self includeCategoryChanges not]) ifTrue:[
  1984         needFilter ifTrue:[
  1947             filteredList := filteredList reject:[:entry | isIgnoredChange value:entry first].
  1985             filteredList := filteredList reject:[:entry | isIgnoredChange value:entry first].
  1948         ].
  1986         ].
  1949         listChanged addAll: (filteredList collect:[:entry| printStringGenerator value:(entry first)]).
  1987         listChanged addAll: (filteredList collect:[:entry| printStringGenerator value:(entry first)]).
  1950     ].
  1988     ].
  1951     methodsChangedFiltered := filteredList.
  1989     methodsChangedFiltered := filteredList.
  1955 
  1993 
  1956     self boxMVisible value:(listChanged isEmpty
  1994     self boxMVisible value:(listChanged isEmpty
  1957                             and: [(listOnlyInA notEmpty
  1995                             and: [(listOnlyInA notEmpty
  1958                                   or:[listOnlyInB notEmpty])]) not.
  1996                                   or:[listOnlyInB notEmpty])]) not.
  1959 
  1997 
       
  1998     info := ''.
  1960     numIgnoredExtensions ~~ 0 ifTrue:[
  1999     numIgnoredExtensions ~~ 0 ifTrue:[
  1961         self infoHolder value:('%1 extension methods ignored.' bindWith:numIgnoredExtensions)
  2000         info := info , ('%1 extension methods ignored. ' bindWith:numIgnoredExtensions).
  1962     ] ifFalse:[
  2001     ].
  1963         self infoHolder value:nil
  2002     numIgnoredVersionMethods ~~ 0 ifTrue:[
  1964     ].
  2003         info := info , ('%1 version methods ignored.' bindWith:numIgnoredVersionMethods).
       
  2004     ].
       
  2005     self infoHolder value:info
  1965 
  2006 
  1966     "Modified: / 17-07-2012 / 18:34:36 / cg"
  2007     "Modified: / 17-07-2012 / 18:34:36 / cg"
  1967 ! !
  2008 ! !
  1968 
  2009 
  1969 !VersionDiffBrowser methodsFor:'setup'!
  2010 !VersionDiffBrowser methodsFor:'setup'!
  2407 ! !
  2448 ! !
  2408 
  2449 
  2409 !VersionDiffBrowser class methodsFor:'documentation'!
  2450 !VersionDiffBrowser class methodsFor:'documentation'!
  2410 
  2451 
  2411 version
  2452 version
  2412     ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.109 2012-10-30 14:26:33 cg Exp $'
  2453     ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.110 2012-10-30 15:26:38 cg Exp $'
  2413 !
  2454 !
  2414 
  2455 
  2415 version_CVS
  2456 version_CVS
  2416     ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.109 2012-10-30 14:26:33 cg Exp $'
  2457     ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.110 2012-10-30 15:26:38 cg Exp $'
  2417 ! !
  2458 ! !