Issue401 history bookmarks
Created originally on Bitbucket by colin-hurley (Colin Hurley)
Was already merged in Bitbucket before import, marked as merged by the import user
-
Add comments to better document the "Show All Tags" functionality
-
Add ColumnType enum to MercurialHistoryPage
This addition attempts to reduce the number of hard-coded column indexes throughout the MercurialHistoryPage class, making it easier to add, remove, and reorder columns without needing to hunt down all places where the column indexes are used. It also improves readability a bit, as the enum names are now used in switch-case blocks, etc. rather than integer numbers.
The column width preference loading has been adjusted to return null if there is any discrepancy between the actual column count and the number of widths in the preference string. The previous behavior was to return null only if the number of columns increased, not if it decreased, but this is not really an appropriate behavior since removal of a column would likely result in columns being set to the wrong widths (e.g. removal of column X would give the persisted column X width to column Y, the persisted column Y width to column Z, and discard the persisted column Z width).
Also, the switch-case blocks handling the column types now attempt to better report programmer error to the user - if a column is not correctly handled by the code, the user will see a message instructing them to submit a bug ticket.
This changeset is mainly internal cleanup. In general, there are no real user-facing changes in this changeset.
-
Add Bookmark column in History view
Similarly to the "extra" tags, the bookmarks are loaded once by MercurialHistory and are then associated with MercurialRevision objects as the corresponding changesets are loaded from the disk. The MercurialHistoryPage builds the Bookmark column text for the History view from the list of associated Bookmark objects in each MercurialRevision. The active bookmark is always listed first.
A new Bookmark model class has been added to the com.vectrace.MercurialEclipse.model package. This class is based on the existing Tag class in that package. The HgBookmarkClient has been adjusted to return this new class from its getBookmarks method, rather than the underlying JavaHg Bookmark type. Existing code has been adjusted to use the getJavaHgBookmarks method, which was added to return the raw JavaHg Bookmark objects so not all code needed to be refactored right now (this new method mirrors the existing getJavaHgTags method in HgTagClient).
fixes #401 (closed)