Hglib::Extension::Topic::

StackEntry

class
Superclass
Object
Included Modules
Hglib::Inspection
Extended With
Hglib::MethodUtilities

A changeset in a topic

Attributes

desc[R]

The changeset description

description[R]

The changeset description

node[R]

The node identifier of the changeset

repo[R]

The Hglib::Repo of the repository the changeset belongs to

stack_index[R]

The index of the changeset in the topic it is currently in

state[R]

An array of states that apply to this changeset(?) :todo: Figure out what these mean

symbol[R]

A character that represents the changeset's (state?) :todo: Figure out what this means

Public Class Methods

anchor
new( repo, entryhash )

Create a new StackEntry for the specified repo given an entryhash like that returned by the JSON template for the `topics` command.

# File lib/hglib/extension/topic.rb, line 102
def initialize( repo, entryhash )
        @repo = repo

        @description = entryhash[:desc]
        @is_entry    = entryhash[:isentry]
        @node        = entryhash[:node]
        @stack_index = entryhash[:stack_index]
        @state       = entryhash[:state]
        @symbol      = entryhash[:symbol]
end

Public Instance Methods

anchor
inspect_details()
Alias for: to_s
anchor
is_entry()

True if the changeset is an entry(?) :todo: Figure out what this means

# File lib/hglib/extension/topic.rb, line 130
attr_predicate :is_entry
anchor
to_s()

Return the entry as a String (in a similar form to the regular `hg topics` output)

# File lib/hglib/extension/topic.rb, line 153
def to_s
        displayed_states = self.state - ['clean']

        rval = String.new( encoding: 'utf-8' )
        rval << %{s%d%s "%s"} % [ self.stack_index, self.symbol, self.description ]
        rval << " (%s)" % [ displayed_states.join(', ') ] unless displayed_states.empty?
        rval.freeze

        return rval
end
Also aliased as: inspect_details