Skip to main content
Engineering LibreTexts

6.3: Exploring Monticello Repositories

  • Page ID
    43821
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Monticello has many other useful features. As we can see in Figure 7.1.1, the Monticello browser window has eight buttons. We have already used four of them — +Package, Save, +Repository and Open. We will now look at Browse and Changes which are used to explore the state and history of repositories.

    Browse

    The Browse button opens a “snapshot browser” to display the contents of a package. The advantage of the snapshot browser over the browser is its ability to display class extensions.

    \(\bigstar\) Select the Perfect package and click the Browse button.

    The snapshot browser.
    Figure \(\PageIndex{1}\): The snapshot browser reveals that the Perfect package extends the class Integer with 2 methods.

    For example, Figure \(\PageIndex{1}\) shows the class extensions defined in the Perfect package. Note that code cannot be edited here, though by action-clicking, if your environment has been set up accordingly) on a class or a method name you can open a regular browser.

    It is good practice to always browse the code of your package before publishing it, to ensure that it really contains what you think it does.

    Changes

    The Changes button computes the difference between the code in the image and the most recent version of the package in the repository.

    \(\bigstar\) Make the following changes to PerfectTest, and then click the Changes button in the Monticello browser.

    PerfectTest»testPerfect
        self assert: 2 isPerfect not.
        self assert: 6 isPerfect.
        self assert: 7 isPerfect not.
        self assert: 496 isPerfect.
    
    PerfectTest»testPerfectTo1000
        self assert: ((1 to: 1000) select: [:each | each isPerfect]) = #(6 28 496)
    
    The patch browser.
    Figure \(\PageIndex{2}\): The patch browser shows the difference between the code in the image and the most recently committed version.

    Figure \(\PageIndex{2}\) shows that the Perfect package has been locally modified with one changed method and one new method. As usual, action-clicking on a change offers you a choice of contextual operations.


    This page titled 6.3: Exploring Monticello Repositories is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by Alexandre Bergel, Damien Cassou, Stéphane Ducasse, Jannik Laval (Square Bracket Associates) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.