Bookmark

class
Superclass
Object

Attributes

name[R]

The name of the bookmark

node[R]

The SHA of the commit the bookmark is currently on

repo[R]

The Hglib::Repo the bookmark lives in

rev[R]

The revision number of the commit the bookmark is currently on

Public Class Methods

anchor
new( repo, bookmark:, node:, rev:, active: false )

Create a new Bookmark with the given values.

# File lib/hglib/repo/bookmark.rb, line 25
def initialize( repo, bookmark:, node:, rev:, active: false  )
        @repo   = repo
        @name   = bookmark
        @node   = node
        @rev    = rev
        @active = active
end

Public Instance Methods

anchor
active()

Whether or not the bookmark is currently active

# File lib/hglib/repo/bookmark.rb, line 56
attr_predicate :active
anchor
delete()

Delete the bookmark from its repository.

# File lib/hglib/repo/bookmark.rb, line 60
def delete
        return self.repo.bookmark( self.name, delete: true )
end
anchor
move_to( revision )

Move the bookmark to the specified revision.

# File lib/hglib/repo/bookmark.rb, line 66
def move_to( revision )
        return self.repo.bookmark( self.name, rev: revision, force: true )
end