An entry in a repository's status list.
Return the Pathname of the file the status applies to
The Pathname of the file the status applies to was copied from (if the status is `A`/`added`) and the addition was via a copy/move operation.
Return the character that denotes the file's status
Create a new log entry from the raw entryhash
.
# File lib/hglib/repo/status_entry.rb, line 23
def initialize( entryhash )
@path = Pathname( entryhash[:path] )
@source = Pathname( entryhash[:source] ) if entryhash.key?( :source )
@status = entryhash[ :status ]
end
Return a human-readable representation of the StatusEntry
as a String.
# File lib/hglib/repo/status_entry.rb, line 65
def inspect
return "#<%p:#%x %s: %s%s>" % [
self.class,
self.object_id * 2,
self.path,
self.status_description,
self.source ? " via copy/move from #{self.source}" : '',
]
end
Return the human-readable status.
# File lib/hglib/repo/status_entry.rb, line 49
def status_description
return case self.status
when 'M' then 'modified'
when 'A' then 'added'
when 'R' then 'removed'
when 'C' then 'clean'
when '!' then 'missing'
when '?' then 'not tracked'
when 'I' then 'ignored'
else
raise "unknown status %p" % [ self.status ]
end
end