Class.st
changeset 2256 ffd565c6e084
parent 2245 d2ae001f71c9
child 2262 4c4d810f006f
equal deleted inserted replaced
2255:0e4c8d88a65d 2256:ffd565c6e084
  1679 addChangeRecordForChangeCategory
  1679 addChangeRecordForChangeCategory
  1680     "{ Pragma: +optSpace }"
  1680     "{ Pragma: +optSpace }"
  1681 
  1681 
  1682     "add a category change record to the changes file"
  1682     "add a category change record to the changes file"
  1683 
  1683 
  1684     self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
  1684     UpdateChangeFileQuerySignal raise ifTrue:[
       
  1685         self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
       
  1686     ]
       
  1687 
       
  1688     "Modified: 24.1.1997 / 19:09:34 / cg"
  1685 !
  1689 !
  1686 
  1690 
  1687 addChangeRecordForClass:aClass
  1691 addChangeRecordForClass:aClass
  1688     "{ Pragma: +optSpace }"
  1692     "{ Pragma: +optSpace }"
  1689 
  1693 
  1690     "add a class-definition-record to the changes file"
  1694     "add a class-definition-record to the changes file"
  1691 
  1695 
  1692     self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
  1696     UpdateChangeFileQuerySignal raise ifTrue:[
       
  1697         self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
       
  1698     ]
       
  1699 
       
  1700     "Modified: 24.1.1997 / 19:09:41 / cg"
  1693 !
  1701 !
  1694 
  1702 
  1695 addChangeRecordForClassCheckIn:aClass
  1703 addChangeRecordForClassCheckIn:aClass
  1696     "{ Pragma: +optSpace }"
  1704     "{ Pragma: +optSpace }"
  1697 
  1705 
  1698     "append a class-was-checkedIn-record to the changes file"
  1706     "append a class-was-checkedIn-record to the changes file"
  1699 
  1707 
  1700     |rv|
  1708     |rv|
  1701 
  1709 
  1702     rv := aClass revision.
  1710     UpdateChangeFileQuerySignal raise ifTrue:[
  1703     rv isNil ifTrue:[rv := '???'].
  1711         rv := aClass revision.
  1704 
  1712         rv isNil ifTrue:[rv := '???'].
  1705     self addInfoRecord:('checkin ' , aClass name , ' (' , rv , ')')
  1713 
       
  1714         self 
       
  1715             writingChangeWithTimeStamp:false 
       
  1716             perform:#addInfoRecord:to: 
       
  1717             with:('checkin ' , aClass name , ' (' , rv , ')').
       
  1718     ]
  1706 
  1719 
  1707     "Created: 18.11.1995 / 17:04:58 / cg"
  1720     "Created: 18.11.1995 / 17:04:58 / cg"
  1708     "Modified: 8.11.1996 / 16:24:00 / cg"
  1721     "Modified: 24.1.1997 / 19:11:55 / cg"
  1709 !
  1722 !
  1710 
  1723 
  1711 addChangeRecordForClassComment:aClass
  1724 addChangeRecordForClassComment:aClass
  1712     "{ Pragma: +optSpace }"
  1725     "{ Pragma: +optSpace }"
  1713 
  1726 
  1714     "add a class-comment-record to the changes file"
  1727     "add a class-comment-record to the changes file"
  1715 
  1728 
  1716     self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
  1729     UpdateChangeFileQuerySignal raise ifTrue:[
       
  1730         self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
       
  1731     ]
       
  1732 
       
  1733     "Modified: 24.1.1997 / 19:09:59 / cg"
  1717 !
  1734 !
  1718 
  1735 
  1719 addChangeRecordForClassContainerRemove:aClass
  1736 addChangeRecordForClassContainerRemove:aClass
  1720     "{ Pragma: +optSpace }"
  1737     "{ Pragma: +optSpace }"
  1721 
  1738 
  1722     "append a container-was-removed-record to the changes file"
  1739     "append a container-was-removed-record to the changes file"
  1723 
  1740 
  1724     self addInfoRecord:('removed source container of ' , aClass name)
  1741     UpdateChangeFileQuerySignal raise ifTrue:[
  1725 
  1742         self 
  1726     "Modified: 7.12.1995 / 23:45:01 / cg"
  1743             writingChangeWithTimeStamp:false 
       
  1744             perform:#addInfoRecord:to: 
       
  1745             with:('removed source container of ' , aClass name).
       
  1746     ]
       
  1747 
  1727     "Created: 11.9.1996 / 15:37:19 / cg"
  1748     "Created: 11.9.1996 / 15:37:19 / cg"
       
  1749     "Modified: 24.1.1997 / 19:12:05 / cg"
  1728 !
  1750 !
  1729 
  1751 
  1730 addChangeRecordForClassFileOut:aClass
  1752 addChangeRecordForClassFileOut:aClass
  1731     "{ Pragma: +optSpace }"
  1753     "{ Pragma: +optSpace }"
  1732 
  1754 
  1733     "append a class-was-filedOut-record to the changes file"
  1755     "append a class-was-filedOut-record to the changes file"
  1734 
  1756 
  1735     self addInfoRecord:('fileOut ' , aClass name) 
  1757     UpdateChangeFileQuerySignal raise ifTrue:[
       
  1758         self 
       
  1759             writingChangeWithTimeStamp:false 
       
  1760             perform:#addInfoRecord:to: 
       
  1761             with:('fileOut ' , aClass name).
       
  1762     ]
       
  1763 
       
  1764     "Modified: 24.1.1997 / 19:12:14 / cg"
  1736 !
  1765 !
  1737 
  1766 
  1738 addChangeRecordForClassInstvars:aClass
  1767 addChangeRecordForClassInstvars:aClass
  1739     "{ Pragma: +optSpace }"
  1768     "{ Pragma: +optSpace }"
  1740 
  1769 
  1741     "add a class-instvars-record to the changes file"
  1770     "add a class-instvars-record to the changes file"
  1742 
  1771 
  1743     self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
  1772     UpdateChangeFileQuerySignal raise ifTrue:[
       
  1773         self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
       
  1774     ]
       
  1775 
       
  1776     "Modified: 24.1.1997 / 19:10:18 / cg"
  1744 !
  1777 !
  1745 
  1778 
  1746 addChangeRecordForClassRemove:oldName
  1779 addChangeRecordForClassRemove:oldName
  1747     "{ Pragma: +optSpace }"
  1780     "{ Pragma: +optSpace }"
  1748 
  1781 
  1749     "add a class-remove-record to the changes file"
  1782     "add a class-remove-record to the changes file"
  1750 
  1783 
  1751     self writingChangePerform:#addChangeRecordForClassRemove:to: with:oldName.
  1784     UpdateChangeFileQuerySignal raise ifTrue:[
       
  1785         self writingChangePerform:#addChangeRecordForClassRemove:to: with:oldName.
       
  1786     ]
       
  1787 
       
  1788     "Modified: 24.1.1997 / 19:10:25 / cg"
  1752 !
  1789 !
  1753 
  1790 
  1754 addChangeRecordForClassRename:oldName to:newName
  1791 addChangeRecordForClassRename:oldName to:newName
  1755     "{ Pragma: +optSpace }"
  1792     "{ Pragma: +optSpace }"
  1756 
  1793 
  1757     "add a class-rename-record to the changes file"
  1794     "add a class-rename-record to the changes file"
  1758 
  1795 
  1759     self writingChangeDo:[:aStream |
  1796     UpdateChangeFileQuerySignal raise ifTrue:[
  1760         self addChangeRecordForClassRename:oldName to:newName to:aStream
  1797         self writingChangeDo:[:aStream |
  1761     ]
  1798             self addChangeRecordForClassRename:oldName to:newName to:aStream
  1762 
  1799         ]
  1763     "Modified: 30.10.1996 / 20:27:20 / cg"
  1800     ]
       
  1801 
       
  1802     "Modified: 24.1.1997 / 19:10:35 / cg"
  1764 !
  1803 !
  1765 
  1804 
  1766 addChangeRecordForMethod:aMethod
  1805 addChangeRecordForMethod:aMethod
  1767     "{ Pragma: +optSpace }"
  1806     "{ Pragma: +optSpace }"
  1768 
  1807 
  1863 addChangeRecordForRemoveSelector:aSelector
  1902 addChangeRecordForRemoveSelector:aSelector
  1864     "{ Pragma: +optSpace }"
  1903     "{ Pragma: +optSpace }"
  1865 
  1904 
  1866     "add a method-remove-record to the changes file"
  1905     "add a method-remove-record to the changes file"
  1867 
  1906 
  1868     self writingChangePerform:#addChangeRecordForRemoveSelector:to: with:aSelector.
  1907     UpdateChangeFileQuerySignal raise ifTrue:[
       
  1908         self writingChangePerform:#addChangeRecordForRemoveSelector:to: with:aSelector.
       
  1909     ]
       
  1910 
       
  1911     "Modified: 24.1.1997 / 19:10:48 / cg"
  1869 !
  1912 !
  1870 
  1913 
  1871 addChangeRecordForRenameCategory:oldCategory to:newCategory
  1914 addChangeRecordForRenameCategory:oldCategory to:newCategory
  1872     "{ Pragma: +optSpace }"
  1915     "{ Pragma: +optSpace }"
  1873 
  1916 
  1874     "add a category-rename record to the changes file"
  1917     "add a category-rename record to the changes file"
  1875 
  1918 
  1876     self writingChangeDo:[:aStream |
  1919     UpdateChangeFileQuerySignal raise ifTrue:[
  1877 	self addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream.
  1920         self writingChangeDo:[:aStream |
  1878     ]
  1921             self addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream.
       
  1922         ]
       
  1923     ]
       
  1924 
       
  1925     "Modified: 24.1.1997 / 19:10:57 / cg"
  1879 !
  1926 !
  1880 
  1927 
  1881 addChangeRecordForSnapshot:aFileName
  1928 addChangeRecordForSnapshot:aFileName
  1882     "{ Pragma: +optSpace }"
  1929     "{ Pragma: +optSpace }"
  1883 
  1930 
  1884     "add a snapshot-record to the changes file"
  1931     "add a snapshot-record to the changes file"
  1885 
  1932 
  1886     self addInfoRecord:('snapshot ' , aFileName) 
  1933     UpdateChangeFileQuerySignal raise ifTrue:[
       
  1934         self 
       
  1935             writingChangeWithTimeStamp:false 
       
  1936             perform:#addInfoRecord:to: 
       
  1937             with:('snapshot ' , aFileName).
       
  1938     ]
       
  1939 
       
  1940     "Modified: 24.1.1997 / 19:12:25 / cg"
  1887 !
  1941 !
  1888 
  1942 
  1889 addChangeRecordForSnapshot:aFileName to:aStream
  1943 addChangeRecordForSnapshot:aFileName to:aStream
  1890     "{ Pragma: +optSpace }"
  1944     "{ Pragma: +optSpace }"
  1891 
  1945 
  1892     "add a snapshot-record to aStream"
  1946     "add a snapshot-record to aStream"
  1893 
  1947 
  1894     self addInfoRecord:('snapshot ' , aFileName) to:aStream
  1948     UpdateChangeFileQuerySignal raise ifTrue:[
       
  1949         self addInfoRecord:('snapshot ' , aFileName) to:aStream
       
  1950     ]
       
  1951 
       
  1952     "Modified: 24.1.1997 / 19:11:08 / cg"
  1895 !
  1953 !
  1896 
  1954 
  1897 addChangeTimeStampTo:aStream
  1955 addChangeTimeStampTo:aStream
  1898     "{ Pragma: +optSpace }"
  1956     "{ Pragma: +optSpace }"
  1899 
  1957 
  1900     "a timestamp - prepended to any change, except infoRecords"
  1958     "a timestamp - prepended to any change, except infoRecords"
  1901 
  1959 
  1902     |info|
  1960     |info|
  1903 
  1961 
  1904     info := 'timestamp ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName.
  1962     UpdateChangeFileQuerySignal raise ifTrue:[
  1905     self addInfoRecord:info to:aStream. aStream cr.
  1963         info := 'timestamp ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName.
       
  1964         self addInfoRecord:info to:aStream. aStream cr.
       
  1965     ]
  1906 
  1966 
  1907     "Created: 18.11.1995 / 15:41:01 / cg"
  1967     "Created: 18.11.1995 / 15:41:01 / cg"
       
  1968     "Modified: 24.1.1997 / 19:11:19 / cg"
  1908 !
  1969 !
  1909 
  1970 
  1910 addInfoRecord:aMessage
  1971 addInfoRecord:aMessage
  1911     "{ Pragma: +optSpace }"
  1972     "{ Pragma: +optSpace }"
  1912 
  1973 
  1913     "add an info-record (snapshot, class fileOut etc.) to the changes file"
  1974     "add an info-record (snapshot, class fileOut etc.) to the changes file"
  1914 
  1975 
  1915     self writingChangeWithTimeStamp:false perform:#addInfoRecord:to: with:aMessage.
  1976     UpdateChangeFileQuerySignal raise ifTrue:[
  1916 
  1977         self writingChangeWithTimeStamp:false 
  1917     "Modified: 5.1.1997 / 19:58:04 / cg"
  1978              perform:#addInfoRecord:to: 
       
  1979              with:aMessage.
       
  1980     ]
       
  1981 
       
  1982     "Modified: 24.1.1997 / 19:13:14 / cg"
  1918 !
  1983 !
  1919 
  1984 
  1920 changesStream
  1985 changesStream
  1921     "return a Stream for the writing changes file - or nil if no update is wanted.
  1986     "return a Stream for the writing changes file.
  1922      This returns a regular stream or a locked stream - according to
  1987      This returns a regular stream or a locked stream - according to
  1923      the LockChangesFile settings 
  1988      the LockChangesFile settings 
  1924      (recommended if multiple images operate on a common changes file)"
  1989      (recommended if multiple images operate on a common changes file)"
  1925 
  1990 
  1926     |streamType aStream fileName|
  1991     |streamType aStream fileName|
  1927 
  1992 
  1928     UpdateChangeFileQuerySignal raise ifTrue:[
  1993     fileName := ObjectMemory nameForChanges.
  1929         fileName := ObjectMemory nameForChanges.
  1994     
  1930         
  1995     LockChangesFile ifTrue:[
  1931         LockChangesFile ifTrue:[
  1996         streamType := LockedFileStream. 
  1932             streamType := LockedFileStream. 
  1997     ] ifFalse:[
  1933         ] ifFalse:[
  1998         streamType := FileStream.
  1934             streamType := FileStream.
  1999     ].
  1935         ].
  2000     aStream := streamType oldFileNamed:fileName.
  1936         aStream := streamType oldFileNamed:fileName.
  2001     aStream isNil ifTrue:[
       
  2002         aStream := streamType newFileNamed:fileName.
  1937         aStream isNil ifTrue:[
  2003         aStream isNil ifTrue:[
  1938             aStream := streamType newFileNamed:fileName.
  2004             self warn:'cannot create/update the changes file'.
  1939             aStream isNil ifTrue:[
  2005             ^ nil
  1940                 self warn:'cannot create/update the changes file'.
  2006         ]
  1941                 ^ nil
  2007     ].
  1942             ]
  2008     aStream setToEnd.
  1943         ].
       
  1944         aStream setToEnd
       
  1945     ].
       
  1946     ^ aStream
  2009     ^ aStream
  1947 
  2010 
  1948     "Created: 28.10.1995 / 16:53:43 / cg"
  2011     "Created: 28.10.1995 / 16:53:43 / cg"
  1949     "Modified: 20.1.1997 / 12:36:20 / cg"
  2012     "Modified: 24.1.1997 / 19:14:27 / cg"
  1950 !
  2013 !
  1951 
  2014 
  1952 sourcesStream
  2015 sourcesStream
  1953     "return a stream for writing the sources file.
  2016     "return a stream for writing the sources file.
  1954      Notice, in ST/X, it is noncommon to use a single
  2017      Notice, in ST/X, it is noncommon to use a single
  3844             ]
  3907             ]
  3845         ]
  3908         ]
  3846     ]
  3909     ]
  3847 
  3910 
  3848     "Created: 18.11.1995 / 15:36:02 / cg"
  3911     "Created: 18.11.1995 / 15:36:02 / cg"
  3849     "Modified: 17.1.1997 / 20:51:06 / cg"
  3912     "Modified: 24.1.1997 / 19:14:48 / cg"
  3850 !
  3913 !
  3851 
  3914 
  3852 writingChangeWithTimeStamp:stampIt perform:aSelector with:anArgument
  3915 writingChangeWithTimeStamp:stampIt perform:aSelector with:anArgument
  3853     "{ Pragma: +optSpace }"
  3916     "{ Pragma: +optSpace }"
  3854 
  3917 
  4760 ! !
  4823 ! !
  4761 
  4824 
  4762 !Class class methodsFor:'documentation'!
  4825 !Class class methodsFor:'documentation'!
  4763 
  4826 
  4764 version
  4827 version
  4765     ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.248 1997-01-23 13:16:06 ca Exp $'
  4828     ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.249 1997-01-24 18:16:48 cg Exp $'
  4766 ! !
  4829 ! !
  4767 Class initialize!
  4830 Class initialize!