Exemplo n.º 1
0
    def single_selection(self):
        """Scan across staged, modified, etc. and return a single item."""
        st = None
        um = None
        m = None
        ut = None

        s = self.selection()
        if s.staged:
            st = s.staged[0]
        elif s.modified:
            m = s.modified[0]
        elif s.unmerged:
            um = s.unmerged[0]
        elif s.untracked:
            ut = s.untracked[0]

        return selection.State(st, um, m, ut)
Exemplo n.º 2
0
 def contents(self):
     return selection.State(self.m.staged, self.m.unmerged, self.m.modified,
                            self.m.untracked)
Exemplo n.º 3
0
 def selection(self):
     """Return the current selection in the repo status tree."""
     return selection.State(self.staged(), self.unmerged(), self.modified(),
                            self.untracked())