Nuclide’s support for Mercurial is much more full-featured that its support for Git. Nuclide has not yet tried to extend the default support for Git provided by Atom.
- Diff View
- File Tree Highlighting
- Line Modification Notifications
- Added and Removed Lines
The Diff View allows you to quickly see what has changed in the files you have modified. It shows what has changed from the current committed revision.
Right-click in the editor and select
Source Control | Open in Diff View in the context-aware menu (alternatively, you can use
Alt-Cmd-Shift-D on Mac or
Alt-Ctrl-Shift-D on Linux).
The Diff View opens in a new tab in the Editing Area. In the bottom pane are the files that have been modified, along with the Mercurial commit on which this diff is based. Click on a file in the bottom pane to see the changes for that file.
The left pane shows what is currently committed for that file, while the right pane displays what you have changed. The highlighted sections are the changed lines.
Here is a picture of the Diff View in action.
If you are tracking, for example, a remote bookmark, and you have a stack of diffs that that have not been pushed to that remote, then the Diff View will show you the entire stack of bookmarks. If you click on each bookmark, you will see the changes associated with that bookmark and all of its children, as compared to the remotely tracked bookmark.
Nuclide provides the capability to show you line-by-line blame (or annotate) for the current file within your Mercurial repository.
Right-click in the editor and select
Source Control | Toggle Blame in the context-aware menu.
The gutter displays the last commit hash on which there was a change for the line and the user who made the change.
File Tree Highlighting
To the left of the Editing Area is Nuclide’s Project Explorer. The Project Explorer’s File Tree tab shows you all of the files that are in your project. In a Mercurial project, the File Tree will also show you what files have changed since your last commit.
If a file is highlighted orange, it indicates a change in that file since your last commit. If a folder in your project is highlighted orange, that means that files in that folder have changed since your last commit. Green files or folders are new. Grey files or folders are ignored or untracked.
Line Modification Notifications
This is a built-in Atom feature that displays in the gutter showing any lines that have been modified since the last commit.
This feature is not enabled by default.
To enable this setting:
- Open the Nuclide Settings tab either by pressing
Ctrl-,on Linux) or by going to
Package | Settings View | Open.
- Select Packages from the list at the left, and search for
- Click on the Settings button for the
- Scroll down until you find
nuclide-hg-repository, and select the Enables
status-bardiff stats to display added, changed, or removed lines in the editor gutter and status bar checkbox.
Then, if a line has been modified, you will see an orange vertical line in the gutter, and if a new line of content has been added, you will see a green vertical line.
Added and Removed Lines
This is a built-in Atom feature that displays in the status bar showing the number of lines that have been added and/or removed since the last commit.
The + value is the number of lines that have been added. The - value is the number of lines that have been removed.
If you change a line (not added or removed), that counts as both an add and a removal, so you might see something like “+1, -1” for a one line modification.
The status bar also shows the current Mercurial bookmark on which you are currently working.