Hglib::Extension::Topic::

Entry

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

A topic in an Hglib::Repo.

Attributes

branch[R]

The name of the branch the topic is on

changeset_count[R]

The number of changesets belonging to the topic

changesetcount[R]

The number of changesets belonging to the topic

last_touched[R]

The human description of when the topic last had changesets added to it (if it was fetched)

lasttouched[R]

The human description of when the topic last had changesets added to it (if it was fetched)

name[R]

The name of the topic

repo[R]

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

touched_by[R]

The name of the last user to add changesets to the topic (if it was fetched)

user_touched[R]

The name of the last user to add changesets to the topic (if it was fetched)

usertouched[R]

The name of the last user to add changesets to the topic (if it was fetched)

Public Class Methods

anchor
new( repo, entryhash )

Create a new Entry 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 19
def initialize( repo, entryhash )
        @repo = repo

        @name            = entryhash[:topic]
        @active          = entryhash[:active]
        @changeset_count = entryhash[:changesetcount]
        @branch          = entryhash[:"branches+"]
        @last_touched    = entryhash[:lasttouched]
        @user_touched    = entryhash[:usertouched]
end

Public Instance Methods

anchor
active()

Whether or not the entry is current active

# File lib/hglib/extension/topic.rb, line 49
attr_predicate :active
anchor
inspect_details()
Alias for: to_s
anchor
stack()

Return the changesets that belong to this topic as Hglib::Extension::Topic::StackEntry objects.

# File lib/hglib/extension/topic.rb, line 87
def stack
        return self.repo.stack( self.name )
end
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 70
def to_s
        rval = String.new( encoding: 'utf-8' )
        rval << "%s (" % [ self.name ]
        rval << "%s" % [ self.last_touched ] if self.last_touched
        rval << " by %s" % [ self.user_touched ] if self.user_touched
        rval << ', ' if self.last_touched || self.user_touched
        rval << "%d changesets)" % [ self.changeset_count ]
        rval << " [active]" if self.active?
        rval.freeze

        return rval
end
Also aliased as: inspect_details