772 Private method used to set the vcs status of a node. |
772 Private method used to set the vcs status of a node. |
773 |
773 |
774 @param item item to work on |
774 @param item item to work on |
775 @param name filename belonging to this item (string) |
775 @param name filename belonging to this item (string) |
776 """ |
776 """ |
777 if self.project.vcs is not None: |
777 vcs = self.project.vcs |
778 state = self.project.vcs.vcsRegisteredState(name) |
778 if vcs is not None: |
779 if state == self.project.vcs.canBeCommitted: |
779 state = vcs.vcsRegisteredState(name) |
780 item.addVcsStatus(self.project.vcs.vcsName()) |
780 if state == vcs.canBeCommitted: |
|
781 item.addVcsStatus(vcs.vcsName()) |
781 else: |
782 else: |
782 item.addVcsStatus(self.tr("local")) |
783 item.addVcsStatus(self.tr("local")) |
783 else: |
784 else: |
784 item.addVcsStatus("") |
785 item.addVcsStatus("") |
785 |
786 |
789 |
790 |
790 @param item item to work on |
791 @param item item to work on |
791 @param name filename belonging to this item (string) |
792 @param name filename belonging to this item (string) |
792 @param recursive flag indicating a recursive update (boolean) |
793 @param recursive flag indicating a recursive update (boolean) |
793 """ |
794 """ |
794 if self.project.vcs is not None: |
795 vcs = self.project.vcs |
795 self.project.vcs.clearStatusCache() |
796 if vcs is not None: |
796 state = self.project.vcs.vcsRegisteredState(name) |
797 vcs.clearStatusCache() |
797 if state == self.project.vcs.canBeCommitted: |
798 state = vcs.vcsRegisteredState(name) |
798 item.setVcsStatus(self.project.vcs.vcsName()) |
799 if state == vcs.canBeCommitted: |
|
800 item.setVcsStatus(vcs.vcsName()) |
799 else: |
801 else: |
800 item.setVcsStatus(self.tr("local")) |
802 item.setVcsStatus(self.tr("local")) |
801 if recursive: |
803 if recursive: |
802 name = os.path.dirname(name) |
804 name = os.path.dirname(name) |
803 parentItem = item.parent() |
805 parentItem = item.parent() |