A topic in an Hglib::Repo
.
The name of the branch the topic is on
The number of changesets belonging to the topic
The number of changesets belonging to the topic
The human description of when the topic last had changesets added to it (if it was fetched)
The human description of when the topic last had changesets added to it (if it was fetched)
The name of the topic
The Hglib::Repo
of the repository the topic belongs to
The name of the last user to add changesets to the topic (if it was fetched)
The name of the last user to add changesets to the topic (if it was fetched)
The name of the last user to add changesets to the topic (if it was fetched)
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
Whether or not the entry is current active
# File lib/hglib/extension/topic.rb, line 49
attr_predicate :active
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
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