LogEntry

class
Superclass
Object
Extended With
Loggability

An entry in a repository's revision log.

Attributes

bookmarks[R]

Return the Array of bookmarks corresponding to the entry (if any)

branch[R]

Return the name of the branch the commit is on

desc[R]

Return the description from the entry

diff[R]

The diff of the commit, if –patch was specified.

files[R]

The files affected by the commit, if run with `verbose: true`.

node[R]

Return the node (changeset ID) from the entry

parents[R]

Return the changeset IDs of the parents of the entry

phase[R]

Return the phase from the entry

rev[R]

Return the revision number from the entry

summary[R]

Return the description from the entry

tags[R]

Return the Array of the entry's tags

user[R]

Return the name and email of the committing user

Public Class Methods

anchor
new( entryhash )

Create a new log entry from the raw entryhash.

# File lib/hglib/repo/log_entry.rb, line 31
def initialize( entryhash )
        @bookmarks = entryhash[ :bookmarks ]
        @branch    = entryhash[ :branch ]
        @date      = entryhash[ :date ]
        @desc      = entryhash[ :desc ]
        @node      = entryhash[ :node ]
        @parents   = entryhash[ :parents ]
        @phase     = entryhash[ :phase ]
        @rev       = entryhash[ :rev ]
        @tags      = entryhash[ :tags ]
        @user      = entryhash[ :user ]
        @date      = entryhash[ :date ]
        @files     = entryhash[ :files ] || []
end

Public Instance Methods

anchor
changeset()

Return the shortened changeset ID (in the form {rev}:{shortnode})

# File lib/hglib/repo/log_entry.rb, line 105
def changeset
        return "%d:%s" % [ self.rev, self.node[0,12] ]
end
anchor
date()

The Time the revision associated with the entry was committed

# File lib/hglib/repo/log_entry.rb, line 98
def date
        return Time.at( @date[0] )
end
Also aliased as: time
anchor
inspect()

Return a human-readable representation of the LogEntry as a String.

# File lib/hglib/repo/log_entry.rb, line 111
def inspect
        parts = []
        parts += self.tags.map {|t| "##{t}" }
        parts += self.bookmarks.map {|b| "@#{b}" }

        return "#<%p:#%x %s {%s} %p%s>" % [
                self.class,
                self.object_id * 2,
                self.changeset,
                self.date,
                self.summary,
                parts.empty? ? '' : " " + parts.join(' ')
        ]
end
anchor
time()
Alias for: date