Пример #1
0
    def run(self, force_refresh=False):
        self.view = self.window.active_view()
        if not self.view:
            # View is not ready yet, try again later.
            sublime.set_timeout(self.run, 1)
            return
        self.clear_all()
        if ViewCollection.untracked(self.view):
            self.bind_files('untracked')
        elif ViewCollection.ignored(self.view):
            self.bind_files('ignored')
        else:
            # If the file is untracked there is no need to execute the diff
            # update
            if force_refresh:
                ViewCollection.clear_git_time(self.view)
            inserted, modified, deleted = ViewCollection.diff(self.view)
            self.lines_removed(deleted)
            self.bind_icons('inserted', inserted)
            self.bind_icons('changed', modified)

            if(ViewCollection.show_status(self.view) != "none"):
                if(ViewCollection.show_status(self.view) == 'all'):
                    branch = ViewCollection.current_branch(
                        self.view).decode("utf-8").strip()
                else:
                    branch = ""

                self.update_status(len(inserted),
                                   len(modified),
                                   len(deleted),
                                   ViewCollection.get_compare(self.view), branch)
            else:
                self.update_status(0, 0, 0, "", "")
Пример #2
0
    def run(self, force_refresh=False):
        self.view = self.window.active_view()
        if not self.view:
            # View is not ready yet, try again later.
            sublime.set_timeout(self.run, 1)
            return
        self.clear_all()
        if ViewCollection.untracked(self.view):
            self.bind_files('untracked')
        elif ViewCollection.ignored(self.view):
            self.bind_files('ignored')
        else:
            # If the file is untracked there is no need to execute the diff
            # update
            if force_refresh:
                ViewCollection.clear_git_time(self.view)
            inserted, modified, deleted = ViewCollection.diff(self.view)
            self.lines_removed(deleted)
            self.bind_icons('inserted', inserted)
            self.bind_icons('changed', modified)

            if (ViewCollection.show_status(self.view) != "none"):
                if (ViewCollection.show_status(self.view) == 'all'):
                    branch = ViewCollection.current_branch(
                        self.view).decode("utf-8").strip()
                else:
                    branch = ""

                self.update_status(len(inserted), len(modified), len(deleted),
                                   ViewCollection.get_compare(self.view),
                                   branch)
            else:
                self.update_status(0, 0, 0, "", "")
Пример #3
0
 def on_select(self, selected):
     if 0 > selected < len(self.results):
         return
     item = self.results[selected]
     commit = self.item_to_commit(item)
     ViewCollection.set_compare(commit)
     ViewCollection.clear_git_time(self.view)
     ViewCollection.add(self.view)
Пример #4
0
 def on_select(self, selected):
     if 0 > selected < len(self.results):
         return
     item = self.results[selected]
     commit = self.item_to_commit(item)
     ViewCollection.set_compare(commit)
     ViewCollection.clear_git_time(self.view)
     ViewCollection.add(self.view)
Пример #5
0
 def run(self, force_refresh=False):
     self.view = self.window.active_view()
     if not self.view:
         # View is not ready yet, try again later.
         sublime.set_timeout(self.run, 1)
         return
     self.clear_all()
     if ViewCollection.untracked(self.view):
         self.bind_files('untracked')
     elif ViewCollection.ignored(self.view):
         self.bind_files('ignored')
     else:
         # If the file is untracked there is no need to execute the diff
         # update
         if force_refresh:
             ViewCollection.clear_git_time(self.view)
         inserted, modified, deleted = ViewCollection.diff(self.view)
         self.lines_removed(deleted)
         self.bind_icons('inserted', inserted)
         self.bind_icons('changed', modified)
Пример #6
0
 def run(self, force_refresh=False):
     self.view = self.window.active_view()
     if not self.view:
         # View is not ready yet, try again later.
         sublime.set_timeout(self.run, 1)
         return
     self.clear_all()
     if ViewCollection.untracked(self.view):
         self.bind_files('untracked')
     elif ViewCollection.ignored(self.view):
         self.bind_files('ignored')
     else:
         # If the file is untracked there is no need to execute the diff
         # update
         if force_refresh:
             ViewCollection.clear_git_time(self.view)
         inserted, modified, deleted = ViewCollection.diff(self.view)
         self.lines_removed(deleted)
         self.bind_icons('inserted', inserted)
         self.bind_icons('changed', modified)
Пример #7
0
 def run(self):
     self.view = self.window.active_view()
     ViewCollection.set_compare("HEAD")
     ViewCollection.clear_git_time(self.view)
     ViewCollection.add(self.view)
Пример #8
0
 def run(self):
     self.view = self.window.active_view()
     ViewCollection.set_compare("HEAD")
     ViewCollection.clear_git_time(self.view)
     ViewCollection.add(self.view)