Swarm 2014.1: User Guide

Diffs

When you view a changelist or code review, the associated files are presented as diffs, short for differences, showing you how they have changed.

initial Diff display

The first row of buttons above the files allow you to (left to right):

Diff buttons for all files

  • Toggle the display of comments

  • Show all diffs as inline

  • Show all diffs as side-by-side

  • Collapse all files

  • Expand all files

Each file is presented with an icon indicating whether the file was:

  • File Added icon Added/branched

  • File Edited/Integrated icon Edited/integrated

  • File Deleted icon Deleted

Diff buttons for a single file

The file's presentation can be controlled with (left to right):

  • Show In-line button, which highlights line additions, modifications, and removals in a single pane.

  • Show Side-by-Side button, which highlights additions, modifications, and removals in two panes, with the older version of the file on the left, and the newer version on the right.

  • Ignore Whitespace button, which toggles the highlighting of whitespace changes in a file, making it easier to identify non-formatting changes.

  • Show Full Context button toggles between displaying only the portions of the file that have changed and the full file (edited and integrated files only).

  • Show File button, displayed only for edited or integrated files, opens a new browser tab/window display the full file (where possible), provide access to its history, and a button to download the file.

The Comments Exist icon

If the file has comments associated, its entry shows a comments exist icon.

Viewing a diff

When you view a diff, the changes are highlighted:

Side-by-Side Diff with an add, edit, and delete

  • Red indicates lines that have been removed

  • Blue indicates lines that have been modified

  • Green indicates lines that have been added

Comments may be presented within the body of a file and appear immediately below the line the commenter targeted for comment.

Side-by-Side Diff with a comment displayed

Note

The Comment Exists Here icon The comment(s) exist here icon appears in the line number column whenever comments exist. This is useful when the comment display is toggled off.

When viewing a diff in-line, the line numbers for the old version are first, and the line numbers for the new version are second, followed by the file content. Some users find this view easier to use when locating an area that has changed, but then switch to side-by-side view to help them understand the change better. Swarm maintains the scroll position; you do not lose your place in the file after toggling the diff view.

Inline Diff

Note

Press n on your keyboard to scroll to the next changed area within a file. Press p to scroll to the previous change.

When a diff contains multiple files, the changes may be taller than your browser window. Swarm keeps the per-file toolbar in view for each file as you scroll, so that you can continue to identify the file at the top of the screen and control its presentation.

The per-file toolbars stay in view as you scroll

0 matching pages