Plugins/VcsPlugins/vcsPySvn/ProjectBrowserHelper.py

changeset 3009
bf5ae5d7477d
parent 2845
7e55c6268c35
child 3019
7912530a33e2
child 3057
10516539f238
equal deleted inserted replaced
3008:7848489bcb92 3009:bf5ae5d7477d
23 23
24 class SvnProjectBrowserHelper(VcsProjectBrowserHelper): 24 class SvnProjectBrowserHelper(VcsProjectBrowserHelper):
25 """ 25 """
26 Class implementing the VCS project browser helper for subversion. 26 Class implementing the VCS project browser helper for subversion.
27 """ 27 """
28 def __init__(self, vcsObject, browserObject, projectObject, isTranslationsBrowser, 28 def __init__(self, vcsObject, browserObject, projectObject,
29 parent=None, name=None): 29 isTranslationsBrowser, parent=None, name=None):
30 """ 30 """
31 Constructor 31 Constructor
32 32
33 @param vcsObject reference to the vcs object 33 @param vcsObject reference to the vcs object
34 @param browserObject reference to the project browser object 34 @param browserObject reference to the project browser object
35 @param projectObject reference to the project object 35 @param projectObject reference to the project object
36 @param isTranslationsBrowser flag indicating, the helper is requested for the 36 @param isTranslationsBrowser flag indicating, the helper is requested
37 translations browser (this needs some special treatment) 37 for the translations browser (this needs some special treatment)
38 @param parent parent widget (QWidget) 38 @param parent parent widget (QWidget)
39 @param name name of this object (string) 39 @param name name of this object (string)
40 """ 40 """
41 VcsProjectBrowserHelper.__init__(self, vcsObject, browserObject, projectObject, 41 VcsProjectBrowserHelper.__init__(self, vcsObject, browserObject,
42 isTranslationsBrowser, parent, name) 42 projectObject, isTranslationsBrowser,
43 parent, name)
43 44
44 def showContextMenu(self, menu, standardItems): 45 def showContextMenu(self, menu, standardItems):
45 """ 46 """
46 Slot called before the context menu is shown. 47 Slot called before the context menu is shown.
47 48
48 It enables/disables the VCS menu entries depending on the overall 49 It enables/disables the VCS menu entries depending on the overall
49 VCS status and the file status. 50 VCS status and the file status.
50 51
51 @param menu reference to the menu to be shown 52 @param menu reference to the menu to be shown
52 @param standardItems array of standard items that need activation/deactivation 53 @param standardItems array of standard items that need
53 depending on the overall VCS status 54 activation/deactivation depending on the overall VCS status
54 """ 55 """
55 if self.browser.currentItem().data(1) == self.vcs.vcsName(): 56 if self.browser.currentItem().data(1) == self.vcs.vcsName():
56 for act in self.vcsMenuActions: 57 for act in self.vcsMenuActions:
57 act.setEnabled(True) 58 act.setEnabled(True)
58 for act in self.vcsAddMenuActions: 59 for act in self.vcsAddMenuActions:
82 83
83 It enables/disables the VCS menu entries depending on the overall 84 It enables/disables the VCS menu entries depending on the overall
84 VCS status and the files status. 85 VCS status and the files status.
85 86
86 @param menu reference to the menu to be shown 87 @param menu reference to the menu to be shown
87 @param standardItems array of standard items that need activation/deactivation 88 @param standardItems array of standard items that need
88 depending on the overall VCS status 89 activation/deactivation depending on the overall VCS status
89 """ 90 """
90 vcsName = self.vcs.vcsName() 91 vcsName = self.vcs.vcsName()
91 items = self.browser.getSelectedItems() 92 items = self.browser.getSelectedItems()
92 vcsItems = 0 93 vcsItems = 0
93 # determine number of selected items under VCS control 94 # determine number of selected items under VCS control
123 124
124 It enables/disables the VCS menu entries depending on the overall 125 It enables/disables the VCS menu entries depending on the overall
125 VCS status and the directory status. 126 VCS status and the directory status.
126 127
127 @param menu reference to the menu to be shown 128 @param menu reference to the menu to be shown
128 @param standardItems array of standard items that need activation/deactivation 129 @param standardItems array of standard items that need
129 depending on the overall VCS status 130 activation/deactivation depending on the overall VCS status
130 """ 131 """
131 if self.browser.currentItem().data(1) == self.vcs.vcsName(): 132 if self.browser.currentItem().data(1) == self.vcs.vcsName():
132 for act in self.vcsDirMenuActions: 133 for act in self.vcsDirMenuActions:
133 act.setEnabled(True) 134 act.setEnabled(True)
134 for act in self.vcsAddDirMenuActions: 135 for act in self.vcsAddDirMenuActions:
149 150
150 It enables/disables the VCS menu entries depending on the overall 151 It enables/disables the VCS menu entries depending on the overall
151 VCS status and the directory status. 152 VCS status and the directory status.
152 153
153 @param menu reference to the menu to be shown 154 @param menu reference to the menu to be shown
154 @param standardItems array of standard items that need activation/deactivation 155 @param standardItems array of standard items that need
155 depending on the overall VCS status 156 activation/deactivation depending on the overall VCS status
156 """ 157 """
157 vcsName = self.vcs.vcsName() 158 vcsName = self.vcs.vcsName()
158 items = self.browser.getSelectedItems() 159 items = self.browser.getSelectedItems()
159 vcsItems = 0 160 vcsItems = 0
160 # determine number of selected items under VCS control 161 # determine number of selected items under VCS control
179 for act in self.vcsAddDirMultiMenuActions: 180 for act in self.vcsAddDirMultiMenuActions:
180 act.setEnabled(True) 181 act.setEnabled(True)
181 for act in standardItems: 182 for act in standardItems:
182 act.setEnabled(True) 183 act.setEnabled(True)
183 184
184 ############################################################################ 185 ###########################################################################
185 # Protected menu generation methods below 186 # Protected menu generation methods below
186 ############################################################################ 187 ###########################################################################
187 188
188 def _addVCSMenu(self, mainMenu): 189 def _addVCSMenu(self, mainMenu):
189 """ 190 """
190 Protected method used to add the VCS menu to all project browsers. 191 Protected method used to add the VCS menu to all project browsers.
191 192
216 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), 217 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"),
217 self.trUtf8('Add to repository'), 218 self.trUtf8('Add to repository'),
218 self._VCSAdd) 219 self._VCSAdd)
219 self.vcsAddMenuActions.append(act) 220 self.vcsAddMenuActions.append(act)
220 if 1 in self.browser.specialMenuEntries: 221 if 1 in self.browser.specialMenuEntries:
221 self.vcsMenuAddTree = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), 222 self.vcsMenuAddTree = menu.addAction(
223 UI.PixmapCache.getIcon("vcsAdd.png"),
222 self.trUtf8('Add tree to repository'), 224 self.trUtf8('Add tree to repository'),
223 self._VCSAddTree) 225 self._VCSAddTree)
224 self.vcsAddMenuActions.append(self.vcsMenuAddTree) 226 self.vcsAddMenuActions.append(self.vcsMenuAddTree)
225 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), 227 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"),
226 self.trUtf8('Remove from repository (and disk)'), 228 self.trUtf8('Remove from repository (and disk)'),
280 self.trUtf8('Revert changes'), self._VCSRevert) 282 self.trUtf8('Revert changes'), self._VCSRevert)
281 self.vcsMenuActions.append(act) 283 self.vcsMenuActions.append(act)
282 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), 284 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"),
283 self.trUtf8('Merge changes'), self._VCSMerge) 285 self.trUtf8('Merge changes'), self._VCSMerge)
284 self.vcsMenuActions.append(act) 286 self.vcsMenuActions.append(act)
285 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) 287 act = menu.addAction(
288 self.trUtf8('Conflict resolved'), self.__SVNResolve)
286 self.vcsMenuActions.append(act) 289 self.vcsMenuActions.append(act)
287 menu.addSeparator() 290 menu.addSeparator()
288 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"), 291 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"),
289 self.trUtf8('Lock'), self.__SVNLock) 292 self.trUtf8('Lock'), self.__SVNLock)
290 self.vcsMenuActions.append(act) 293 self.vcsMenuActions.append(act)
298 self.trUtf8('Steal Lock'), self.__SVNStealLock) 301 self.trUtf8('Steal Lock'), self.__SVNStealLock)
299 self.vcsMenuActions.append(act) 302 self.vcsMenuActions.append(act)
300 menu.addSeparator() 303 menu.addSeparator()
301 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 304 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
302 self.vcsMenuActions.append(act) 305 self.vcsMenuActions.append(act)
303 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) 306 act = menu.addAction(
307 self.trUtf8('List Properties'), self.__SVNListProps)
304 self.vcsMenuActions.append(act) 308 self.vcsMenuActions.append(act)
305 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 309 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
306 self.vcsMenuActions.append(act) 310 self.vcsMenuActions.append(act)
307 menu.addSeparator() 311 menu.addSeparator()
308 menu.addAction(self.trUtf8('Select all local file entries'), 312 menu.addAction(self.trUtf8('Select all local file entries'),
387 self.vcsMultiMenuActions.append(act) 391 self.vcsMultiMenuActions.append(act)
388 menu.addSeparator() 392 menu.addSeparator()
389 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"), 393 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"),
390 self.trUtf8('Revert changes'), self._VCSRevert) 394 self.trUtf8('Revert changes'), self._VCSRevert)
391 self.vcsMultiMenuActions.append(act) 395 self.vcsMultiMenuActions.append(act)
392 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) 396 act = menu.addAction(
397 self.trUtf8('Conflict resolved'), self.__SVNResolve)
393 self.vcsMultiMenuActions.append(act) 398 self.vcsMultiMenuActions.append(act)
394 menu.addSeparator() 399 menu.addSeparator()
395 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"), 400 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"),
396 self.trUtf8('Lock'), self.__SVNLock) 401 self.trUtf8('Lock'), self.__SVNLock)
397 self.vcsMultiMenuActions.append(act) 402 self.vcsMultiMenuActions.append(act)
405 self.trUtf8('Steal Lock'), self.__SVNStealLock) 410 self.trUtf8('Steal Lock'), self.__SVNStealLock)
406 self.vcsMultiMenuActions.append(act) 411 self.vcsMultiMenuActions.append(act)
407 menu.addSeparator() 412 menu.addSeparator()
408 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 413 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
409 self.vcsMultiMenuActions.append(act) 414 self.vcsMultiMenuActions.append(act)
410 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) 415 act = menu.addAction(
416 self.trUtf8('List Properties'), self.__SVNListProps)
411 self.vcsMultiMenuActions.append(act) 417 self.vcsMultiMenuActions.append(act)
412 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 418 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
413 self.vcsMultiMenuActions.append(act) 419 self.vcsMultiMenuActions.append(act)
414 menu.addSeparator() 420 menu.addSeparator()
415 menu.addAction(self.trUtf8('Select all local file entries'), 421 menu.addAction(self.trUtf8('Select all local file entries'),
541 self.trUtf8('Revert changes'), self._VCSRevert) 547 self.trUtf8('Revert changes'), self._VCSRevert)
542 self.vcsDirMenuActions.append(act) 548 self.vcsDirMenuActions.append(act)
543 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), 549 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"),
544 self.trUtf8('Merge changes'), self._VCSMerge) 550 self.trUtf8('Merge changes'), self._VCSMerge)
545 self.vcsDirMenuActions.append(act) 551 self.vcsDirMenuActions.append(act)
546 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) 552 act = menu.addAction(
553 self.trUtf8('Conflict resolved'), self.__SVNResolve)
547 self.vcsDirMenuActions.append(act) 554 self.vcsDirMenuActions.append(act)
548 menu.addSeparator() 555 menu.addSeparator()
549 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 556 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
550 self.vcsDirMenuActions.append(act) 557 self.vcsDirMenuActions.append(act)
551 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) 558 act = menu.addAction(
559 self.trUtf8('List Properties'), self.__SVNListProps)
552 self.vcsDirMenuActions.append(act) 560 self.vcsDirMenuActions.append(act)
553 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 561 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
554 self.vcsDirMenuActions.append(act) 562 self.vcsDirMenuActions.append(act)
555 menu.addSeparator() 563 menu.addSeparator()
556 menu.addAction(self.trUtf8('Select all local file entries'), 564 menu.addAction(self.trUtf8('Select all local file entries'),
635 self.trUtf8('Revert changes'), self._VCSRevert) 643 self.trUtf8('Revert changes'), self._VCSRevert)
636 self.vcsDirMultiMenuActions.append(act) 644 self.vcsDirMultiMenuActions.append(act)
637 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), 645 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"),
638 self.trUtf8('Merge changes'), self._VCSMerge) 646 self.trUtf8('Merge changes'), self._VCSMerge)
639 self.vcsDirMultiMenuActions.append(act) 647 self.vcsDirMultiMenuActions.append(act)
640 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) 648 act = menu.addAction(
649 self.trUtf8('Conflict resolved'), self.__SVNResolve)
641 self.vcsDirMultiMenuActions.append(act) 650 self.vcsDirMultiMenuActions.append(act)
642 menu.addSeparator() 651 menu.addSeparator()
643 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 652 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
644 self.vcsDirMultiMenuActions.append(act) 653 self.vcsDirMultiMenuActions.append(act)
645 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) 654 act = menu.addAction(
655 self.trUtf8('List Properties'), self.__SVNListProps)
646 self.vcsDirMultiMenuActions.append(act) 656 self.vcsDirMultiMenuActions.append(act)
647 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 657 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
648 self.vcsDirMultiMenuActions.append(act) 658 self.vcsDirMultiMenuActions.append(act)
649 menu.addSeparator() 659 menu.addSeparator()
650 menu.addAction(self.trUtf8('Select all local file entries'), 660 menu.addAction(self.trUtf8('Select all local file entries'),
660 670
661 mainMenu.addSeparator() 671 mainMenu.addSeparator()
662 mainMenu.addMenu(menu) 672 mainMenu.addMenu(menu)
663 self.menuDirMulti = menu 673 self.menuDirMulti = menu
664 674
665 ############################################################################ 675 ###########################################################################
666 # Menu handling methods below 676 # Menu handling methods below
667 ############################################################################ 677 ###########################################################################
668 678
669 def __SVNCopy(self): 679 def __SVNCopy(self):
670 """ 680 """
671 Private slot called by the context menu to copy the selected file. 681 Private slot called by the context menu to copy the selected file.
672 """ 682 """
707 names.append(itm.dirName()) 717 names.append(itm.dirName())
708 self.vcs.svnResolve(names) 718 self.vcs.svnResolve(names)
709 719
710 def __SVNListProps(self): 720 def __SVNListProps(self):
711 """ 721 """
712 Private slot called by the context menu to list the subversion properties of 722 Private slot called by the context menu to list the subversion
713 a file. 723 properties of a file.
714 """ 724 """
715 names = [] 725 names = []
716 for itm in self.browser.getSelectedItems(): 726 for itm in self.browser.getSelectedItems():
717 try: 727 try:
718 names.append(itm.fileName()) 728 names.append(itm.fileName())
720 names.append(itm.dirName()) 730 names.append(itm.dirName())
721 self.vcs.svnListProps(names) 731 self.vcs.svnListProps(names)
722 732
723 def __SVNSetProp(self): 733 def __SVNSetProp(self):
724 """ 734 """
725 Private slot called by the context menu to set a subversion property of a file. 735 Private slot called by the context menu to set a subversion
736 property of a file.
726 """ 737 """
727 names = [] 738 names = []
728 for itm in self.browser.getSelectedItems(): 739 for itm in self.browser.getSelectedItems():
729 try: 740 try:
730 names.append(itm.fileName()) 741 names.append(itm.fileName())
732 names.append(itm.dirName()) 743 names.append(itm.dirName())
733 self.vcs.svnSetProp(names) 744 self.vcs.svnSetProp(names)
734 745
735 def __SVNDelProp(self): 746 def __SVNDelProp(self):
736 """ 747 """
737 Private slot called by the context menu to delete a subversion property of a file. 748 Private slot called by the context menu to delete a subversion
749 property of a file.
738 """ 750 """
739 names = [] 751 names = []
740 for itm in self.browser.getSelectedItems(): 752 for itm in self.browser.getSelectedItems():
741 try: 753 try:
742 names.append(itm.fileName()) 754 names.append(itm.fileName())
744 names.append(itm.dirName()) 756 names.append(itm.dirName())
745 self.vcs.svnDelProp(names) 757 self.vcs.svnDelProp(names)
746 758
747 def __SVNExtendedDiff(self): 759 def __SVNExtendedDiff(self):
748 """ 760 """
749 Private slot called by the context menu to show the difference of a file to 761 Private slot called by the context menu to show the difference of a
750 the repository. 762 file to the repository.
751 763
752 This gives the chance to enter the revisions to compare. 764 This gives the chance to enter the revisions to compare.
753 """ 765 """
754 names = [] 766 names = []
755 for itm in self.browser.getSelectedItems(): 767 for itm in self.browser.getSelectedItems():
759 names.append(itm.dirName()) 771 names.append(itm.dirName())
760 self.vcs.svnExtendedDiff(names) 772 self.vcs.svnExtendedDiff(names)
761 773
762 def __SVNUrlDiff(self): 774 def __SVNUrlDiff(self):
763 """ 775 """
764 Private slot called by the context menu to show the difference of a file of 776 Private slot called by the context menu to show the difference of a
765 two repository URLs. 777 file of two repository URLs.
766 778
767 This gives the chance to enter the repository URLs to compare. 779 This gives the chance to enter the repository URLs to compare.
768 """ 780 """
769 names = [] 781 names = []
770 for itm in self.browser.getSelectedItems(): 782 for itm in self.browser.getSelectedItems():
774 names.append(itm.dirName()) 786 names.append(itm.dirName())
775 self.vcs.svnUrlDiff(names) 787 self.vcs.svnUrlDiff(names)
776 788
777 def __SVNSbsDiff(self): 789 def __SVNSbsDiff(self):
778 """ 790 """
779 Private slot called by the context menu to show the difference of a file to 791 Private slot called by the context menu to show the difference of a
780 the repository side-by-side. 792 file to the repository side-by-side.
781 """ 793 """
782 itm = self.browser.currentItem() 794 itm = self.browser.currentItem()
783 fn = itm.fileName() 795 fn = itm.fileName()
784 self.vcs.svnSbsDiff(fn) 796 self.vcs.svnSbsDiff(fn)
785 797
786 def __SVNSbsExtendedDiff(self): 798 def __SVNSbsExtendedDiff(self):
787 """ 799 """
788 Private slot called by the context menu to show the difference of a file to 800 Private slot called by the context menu to show the difference of a
789 the repository side-by-side allowing the selection of revisions to compare. 801 file to the repository side-by-side allowing the selection of
802 revisions to compare.
790 """ 803 """
791 itm = self.browser.currentItem() 804 itm = self.browser.currentItem()
792 fn = itm.fileName() 805 fn = itm.fileName()
793 self.vcs.svnSbsDiff(fn, extended=True) 806 self.vcs.svnSbsDiff(fn, extended=True)
794 807
795 def __SVNLogBrowser(self): 808 def __SVNLogBrowser(self):
796 """ 809 """
797 Private slot called by the context menu to show the log browser for a file. 810 Private slot called by the context menu to show the log browser for a
811 file.
798 """ 812 """
799 itm = self.browser.currentItem() 813 itm = self.browser.currentItem()
800 try: 814 try:
801 fn = itm.fileName() 815 fn = itm.fileName()
802 isFile = True 816 isFile = True
813 fn = itm.fileName() 827 fn = itm.fileName()
814 self.vcs.svnBlame(fn) 828 self.vcs.svnBlame(fn)
815 829
816 def __SVNLock(self): 830 def __SVNLock(self):
817 """ 831 """
818 Private slot called by the context menu to lock files in the repository. 832 Private slot called by the context menu to lock files in the
833 repository.
819 """ 834 """
820 names = [] 835 names = []
821 for itm in self.browser.getSelectedItems(): 836 for itm in self.browser.getSelectedItems():
822 try: 837 try:
823 names.append(itm.fileName()) 838 names.append(itm.fileName())
825 names.append(itm.dirName()) 840 names.append(itm.dirName())
826 self.vcs.svnLock(names) 841 self.vcs.svnLock(names)
827 842
828 def __SVNUnlock(self): 843 def __SVNUnlock(self):
829 """ 844 """
830 Private slot called by the context menu to unlock files in the repository. 845 Private slot called by the context menu to unlock files in the
846 repository.
831 """ 847 """
832 names = [] 848 names = []
833 for itm in self.browser.getSelectedItems(): 849 for itm in self.browser.getSelectedItems():
834 try: 850 try:
835 names.append(itm.fileName()) 851 names.append(itm.fileName())
837 names.append(itm.dirName()) 853 names.append(itm.dirName())
838 self.vcs.svnUnlock(names) 854 self.vcs.svnUnlock(names)
839 855
840 def __SVNBreakLock(self): 856 def __SVNBreakLock(self):
841 """ 857 """
842 Private slot called by the context menu to break lock files in the repository. 858 Private slot called by the context menu to break lock files in the
859 repository.
843 """ 860 """
844 names = [] 861 names = []
845 for itm in self.browser.getSelectedItems(): 862 for itm in self.browser.getSelectedItems():
846 try: 863 try:
847 names.append(itm.fileName()) 864 names.append(itm.fileName())
849 names.append(itm.dirName()) 866 names.append(itm.dirName())
850 self.vcs.svnUnlock(names, breakIt=True) 867 self.vcs.svnUnlock(names, breakIt=True)
851 868
852 def __SVNStealLock(self): 869 def __SVNStealLock(self):
853 """ 870 """
854 Private slot called by the context menu to steal lock files in the repository. 871 Private slot called by the context menu to steal lock files in the
872 repository.
855 """ 873 """
856 names = [] 874 names = []
857 for itm in self.browser.getSelectedItems(): 875 for itm in self.browser.getSelectedItems():
858 try: 876 try:
859 names.append(itm.fileName()) 877 names.append(itm.fileName())
861 names.append(itm.dirName()) 879 names.append(itm.dirName())
862 self.vcs.svnLock(names, stealIt=True) 880 self.vcs.svnLock(names, stealIt=True)
863 881
864 def __SVNInfo(self): 882 def __SVNInfo(self):
865 """ 883 """
866 Private slot called by the context menu to show repository information of 884 Private slot called by the context menu to show repository information
867 a file or directory. 885 of a file or directory.
868 """ 886 """
869 try: 887 try:
870 name = self.browser.currentItem().fileName() 888 name = self.browser.currentItem().fileName()
871 except AttributeError: 889 except AttributeError:
872 name = self.browser.currentItem().dirName() 890 name = self.browser.currentItem().dirName()
875 893
876 def __SVNConfigure(self): 894 def __SVNConfigure(self):
877 """ 895 """
878 Private method to open the configuration dialog. 896 Private method to open the configuration dialog.
879 """ 897 """
880 e5App().getObject("UserInterface").showPreferences("zzz_subversionPage") 898 e5App().getObject("UserInterface")\
899 .showPreferences("zzz_subversionPage")
881 900
882 def __SVNAddToChangelist(self): 901 def __SVNAddToChangelist(self):
883 """ 902 """
884 Private slot called by the context menu to add files to a changelist. 903 Private slot called by the context menu to add files to a changelist.
885 """ 904 """
891 names.append(itm.dirName()) 910 names.append(itm.dirName())
892 self.vcs.svnAddToChangelist(names) 911 self.vcs.svnAddToChangelist(names)
893 912
894 def __SVNRemoveFromChangelist(self): 913 def __SVNRemoveFromChangelist(self):
895 """ 914 """
896 Private slot called by the context menu to remove files from their changelist. 915 Private slot called by the context menu to remove files from their
916 changelist.
897 """ 917 """
898 names = [] 918 names = []
899 for itm in self.browser.getSelectedItems(): 919 for itm in self.browser.getSelectedItems():
900 try: 920 try:
901 names.append(itm.fileName()) 921 names.append(itm.fileName())
902 except AttributeError: 922 except AttributeError:
903 names.append(itm.dirName()) 923 names.append(itm.dirName())
904 self.vcs.svnRemoveFromChangelist(names) 924 self.vcs.svnRemoveFromChangelist(names)
905 925
906 ############################################################################ 926 ###########################################################################
907 # Some private utility methods below 927 # Some private utility methods below
908 ############################################################################ 928 ###########################################################################
909 929
910 def __itemsHaveFiles(self, items): 930 def __itemsHaveFiles(self, items):
911 """ 931 """
912 Private method to check, if items contain file type items. 932 Private method to check, if items contain file type items.
913 933

eric ide

mercurial