Class: Amp::Repositories::DirStateEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/amp/repository/dir_state.rb

Overview

An entry in the dirstate. Similar to IndexEntry for revlogs. Simple struct, that’s all.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#modeObject

Returns the value of attribute mode

Returns:

  • (Object)

    the current value of mode



7
8
9
# File 'lib/amp/repository/dir_state.rb', line 7

def mode
  @mode
end

#mtimeObject

Returns the value of attribute mtime

Returns:

  • (Object)

    the current value of mtime



7
8
9
# File 'lib/amp/repository/dir_state.rb', line 7

def mtime
  @mtime
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



7
8
9
# File 'lib/amp/repository/dir_state.rb', line 7

def size
  @size
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



7
8
9
# File 'lib/amp/repository/dir_state.rb', line 7

def status
  @status
end

Instance Method Details

#added?Boolean

Returns:



12
# File 'lib/amp/repository/dir_state.rb', line 12

def added?;       self.status == :added; end

#dirty?Boolean

Do I represent a dirty object?

Returns:

  • (Boolean)

    does this array represent a dirty object in a DirState?



23
24
25
# File 'lib/amp/repository/dir_state.rb', line 23

def dirty?
  self[-2] == -2 && self[-1] == -1 && self.normal?
end

#forgotten?Boolean

Returns:



17
# File 'lib/amp/repository/dir_state.rb', line 17

def forgotten?;   self.status == :forgotten; end

#maybe_dirty?Boolean

Do I possibly represent a dirty object?

Returns:

  • (Boolean)

    does this array possibly represent a dirty object in a DirState?



31
32
33
# File 'lib/amp/repository/dir_state.rb', line 31

def maybe_dirty?
  self[-2] == -1 && self[-1] == -1 && self.normal?
end

#merged?Boolean

Returns:



15
# File 'lib/amp/repository/dir_state.rb', line 15

def merged?;      self.status == :merged; end

#modified?Boolean

Returns:



14
# File 'lib/amp/repository/dir_state.rb', line 14

def modified?;    self.status == :modified; end

#normal?Boolean

Returns:



16
# File 'lib/amp/repository/dir_state.rb', line 16

def normal?;      self.status == :normal; end

#removed?Boolean

shortcuts!

Returns:



11
# File 'lib/amp/repository/dir_state.rb', line 11

def removed?;     self.status == :removed; end

#untracked?Boolean

Returns:



13
# File 'lib/amp/repository/dir_state.rb', line 13

def untracked?;   self.status == :untracked; end