Plugins/VcsPlugins/vcsSubversion/ProjectBrowserHelper.py

changeset 3009
bf5ae5d7477d
parent 2845
7e55c6268c35
child 3019
7912530a33e2
child 3057
10516539f238
equal deleted inserted replaced
3008:7848489bcb92 3009:bf5ae5d7477d
21 21
22 class SvnProjectBrowserHelper(VcsProjectBrowserHelper): 22 class SvnProjectBrowserHelper(VcsProjectBrowserHelper):
23 """ 23 """
24 Class implementing the VCS project browser helper for subversion. 24 Class implementing the VCS project browser helper for subversion.
25 """ 25 """
26 def __init__(self, vcsObject, browserObject, projectObject, isTranslationsBrowser, 26 def __init__(self, vcsObject, browserObject, projectObject,
27 parent=None, name=None): 27 isTranslationsBrowser, parent=None, name=None):
28 """ 28 """
29 Constructor 29 Constructor
30 30
31 @param vcsObject reference to the vcs object 31 @param vcsObject reference to the vcs object
32 @param browserObject reference to the project browser object 32 @param browserObject reference to the project browser object
33 @param projectObject reference to the project object 33 @param projectObject reference to the project object
34 @param isTranslationsBrowser flag indicating, the helper is requested for the 34 @param isTranslationsBrowser flag indicating, the helper is requested
35 translations browser (this needs some special treatment) 35 for the translations browser (this needs some special treatment)
36 @param parent parent widget (QWidget) 36 @param parent parent widget (QWidget)
37 @param name name of this object (string) 37 @param name name of this object (string)
38 """ 38 """
39 VcsProjectBrowserHelper.__init__(self, vcsObject, browserObject, projectObject, 39 VcsProjectBrowserHelper.__init__(self, vcsObject, browserObject,
40 isTranslationsBrowser, parent, name) 40 projectObject, isTranslationsBrowser,
41 parent, name)
41 42
42 def showContextMenu(self, menu, standardItems): 43 def showContextMenu(self, menu, standardItems):
43 """ 44 """
44 Slot called before the context menu is shown. 45 Slot called before the context menu is shown.
45 46
46 It enables/disables the VCS menu entries depending on the overall 47 It enables/disables the VCS menu entries depending on the overall
47 VCS status and the file status. 48 VCS status and the file status.
48 49
49 @param menu reference to the menu to be shown 50 @param menu reference to the menu to be shown
50 @param standardItems array of standard items that need activation/deactivation 51 @param standardItems array of standard items that need
51 depending on the overall VCS status 52 activation/deactivation depending on the overall VCS status
52 """ 53 """
53 if self.browser.currentItem().data(1) == self.vcs.vcsName(): 54 if self.browser.currentItem().data(1) == self.vcs.vcsName():
54 for act in self.vcsMenuActions: 55 for act in self.vcsMenuActions:
55 act.setEnabled(True) 56 act.setEnabled(True)
56 for act in self.vcsAddMenuActions: 57 for act in self.vcsAddMenuActions:
80 81
81 It enables/disables the VCS menu entries depending on the overall 82 It enables/disables the VCS menu entries depending on the overall
82 VCS status and the files status. 83 VCS status and the files status.
83 84
84 @param menu reference to the menu to be shown 85 @param menu reference to the menu to be shown
85 @param standardItems array of standard items that need activation/deactivation 86 @param standardItems array of standard items that need
86 depending on the overall VCS status 87 activation/deactivation depending on the overall VCS status
87 """ 88 """
88 vcsName = self.vcs.vcsName() 89 vcsName = self.vcs.vcsName()
89 items = self.browser.getSelectedItems() 90 items = self.browser.getSelectedItems()
90 vcsItems = 0 91 vcsItems = 0
91 # determine number of selected items under VCS control 92 # determine number of selected items under VCS control
121 122
122 It enables/disables the VCS menu entries depending on the overall 123 It enables/disables the VCS menu entries depending on the overall
123 VCS status and the directory status. 124 VCS status and the directory status.
124 125
125 @param menu reference to the menu to be shown 126 @param menu reference to the menu to be shown
126 @param standardItems array of standard items that need activation/deactivation 127 @param standardItems array of standard items that need
127 depending on the overall VCS status 128 activation/deactivation depending on the overall VCS status
128 """ 129 """
129 if self.browser.currentItem().data(1) == self.vcs.vcsName(): 130 if self.browser.currentItem().data(1) == self.vcs.vcsName():
130 for act in self.vcsDirMenuActions: 131 for act in self.vcsDirMenuActions:
131 act.setEnabled(True) 132 act.setEnabled(True)
132 for act in self.vcsAddDirMenuActions: 133 for act in self.vcsAddDirMenuActions:
147 148
148 It enables/disables the VCS menu entries depending on the overall 149 It enables/disables the VCS menu entries depending on the overall
149 VCS status and the directory status. 150 VCS status and the directory status.
150 151
151 @param menu reference to the menu to be shown 152 @param menu reference to the menu to be shown
152 @param standardItems array of standard items that need activation/deactivation 153 @param standardItems array of standard items that need
153 depending on the overall VCS status 154 activation/deactivation depending on the overall VCS status
154 """ 155 """
155 vcsName = self.vcs.vcsName() 156 vcsName = self.vcs.vcsName()
156 items = self.browser.getSelectedItems() 157 items = self.browser.getSelectedItems()
157 vcsItems = 0 158 vcsItems = 0
158 # determine number of selected items under VCS control 159 # determine number of selected items under VCS control
177 for act in self.vcsAddDirMultiMenuActions: 178 for act in self.vcsAddDirMultiMenuActions:
178 act.setEnabled(True) 179 act.setEnabled(True)
179 for act in standardItems: 180 for act in standardItems:
180 act.setEnabled(True) 181 act.setEnabled(True)
181 182
182 ############################################################################ 183 ###########################################################################
183 # Protected menu generation methods below 184 # Protected menu generation methods below
184 ############################################################################ 185 ###########################################################################
185 186
186 def _addVCSMenu(self, mainMenu): 187 def _addVCSMenu(self, mainMenu):
187 """ 188 """
188 Protected method used to add the VCS menu to all project browsers. 189 Protected method used to add the VCS menu to all project browsers.
189 190
194 195
195 menu = QMenu(self.trUtf8("Version Control")) 196 menu = QMenu(self.trUtf8("Version Control"))
196 197
197 act = menu.addAction( 198 act = menu.addAction(
198 UI.PixmapCache.getIcon( 199 UI.PixmapCache.getIcon(
199 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), 200 os.path.join("VcsPlugins", "vcsSubversion", "icons",
201 "subversion.png")),
200 self.vcs.vcsName(), self._VCSInfoDisplay) 202 self.vcs.vcsName(), self._VCSInfoDisplay)
201 font = act.font() 203 font = act.font()
202 font.setBold(True) 204 font.setBold(True)
203 act.setFont(font) 205 act.setFont(font)
204 menu.addSeparator() 206 menu.addSeparator()
214 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), 216 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"),
215 self.trUtf8('Add to repository'), 217 self.trUtf8('Add to repository'),
216 self._VCSAdd) 218 self._VCSAdd)
217 self.vcsAddMenuActions.append(act) 219 self.vcsAddMenuActions.append(act)
218 if 1 in self.browser.specialMenuEntries: 220 if 1 in self.browser.specialMenuEntries:
219 self.vcsMenuAddTree = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), 221 self.vcsMenuAddTree = menu.addAction(
222 UI.PixmapCache.getIcon("vcsAdd.png"),
220 self.trUtf8('Add tree to repository'), 223 self.trUtf8('Add tree to repository'),
221 self._VCSAddTree) 224 self._VCSAddTree)
222 self.vcsAddMenuActions.append(self.vcsMenuAddTree) 225 self.vcsAddMenuActions.append(self.vcsMenuAddTree)
223 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), 226 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"),
224 self.trUtf8('Remove from repository (and disk)'), 227 self.trUtf8('Remove from repository (and disk)'),
275 self.trUtf8('Revert changes'), self._VCSRevert) 278 self.trUtf8('Revert changes'), self._VCSRevert)
276 self.vcsMenuActions.append(act) 279 self.vcsMenuActions.append(act)
277 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), 280 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"),
278 self.trUtf8('Merge changes'), self._VCSMerge) 281 self.trUtf8('Merge changes'), self._VCSMerge)
279 self.vcsMenuActions.append(act) 282 self.vcsMenuActions.append(act)
280 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) 283 act = menu.addAction(
284 self.trUtf8('Conflict resolved'), self.__SVNResolve)
281 self.vcsMenuActions.append(act) 285 self.vcsMenuActions.append(act)
282 if self.vcs.version >= (1, 2, 0): 286 if self.vcs.version >= (1, 2, 0):
283 menu.addSeparator() 287 menu.addSeparator()
284 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"), 288 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"),
285 self.trUtf8('Lock'), self.__SVNLock) 289 self.trUtf8('Lock'), self.__SVNLock)
294 self.trUtf8('Steal Lock'), self.__SVNStealLock) 298 self.trUtf8('Steal Lock'), self.__SVNStealLock)
295 self.vcsMenuActions.append(act) 299 self.vcsMenuActions.append(act)
296 menu.addSeparator() 300 menu.addSeparator()
297 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 301 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
298 self.vcsMenuActions.append(act) 302 self.vcsMenuActions.append(act)
299 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) 303 act = menu.addAction(
304 self.trUtf8('List Properties'), self.__SVNListProps)
300 self.vcsMenuActions.append(act) 305 self.vcsMenuActions.append(act)
301 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 306 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
302 self.vcsMenuActions.append(act) 307 self.vcsMenuActions.append(act)
303 menu.addSeparator() 308 menu.addSeparator()
304 menu.addAction(self.trUtf8('Select all local file entries'), 309 menu.addAction(self.trUtf8('Select all local file entries'),
328 333
329 menu = QMenu(self.trUtf8("Version Control")) 334 menu = QMenu(self.trUtf8("Version Control"))
330 335
331 act = menu.addAction( 336 act = menu.addAction(
332 UI.PixmapCache.getIcon( 337 UI.PixmapCache.getIcon(
333 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), 338 os.path.join("VcsPlugins", "vcsSubversion", "icons",
339 "subversion.png")),
334 self.vcs.vcsName(), self._VCSInfoDisplay) 340 self.vcs.vcsName(), self._VCSInfoDisplay)
335 font = act.font() 341 font = act.font()
336 font.setBold(True) 342 font.setBold(True)
337 act.setFont(font) 343 act.setFont(font)
338 menu.addSeparator() 344 menu.addSeparator()
383 self.vcsMultiMenuActions.append(act) 389 self.vcsMultiMenuActions.append(act)
384 menu.addSeparator() 390 menu.addSeparator()
385 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"), 391 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"),
386 self.trUtf8('Revert changes'), self._VCSRevert) 392 self.trUtf8('Revert changes'), self._VCSRevert)
387 self.vcsMultiMenuActions.append(act) 393 self.vcsMultiMenuActions.append(act)
388 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) 394 act = menu.addAction(
395 self.trUtf8('Conflict resolved'), self.__SVNResolve)
389 self.vcsMultiMenuActions.append(act) 396 self.vcsMultiMenuActions.append(act)
390 if self.vcs.version >= (1, 2, 0): 397 if self.vcs.version >= (1, 2, 0):
391 menu.addSeparator() 398 menu.addSeparator()
392 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"), 399 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"),
393 self.trUtf8('Lock'), self.__SVNLock) 400 self.trUtf8('Lock'), self.__SVNLock)
402 self.trUtf8('Steal Lock'), self.__SVNStealLock) 409 self.trUtf8('Steal Lock'), self.__SVNStealLock)
403 self.vcsMultiMenuActions.append(act) 410 self.vcsMultiMenuActions.append(act)
404 menu.addSeparator() 411 menu.addSeparator()
405 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 412 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
406 self.vcsMultiMenuActions.append(act) 413 self.vcsMultiMenuActions.append(act)
407 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) 414 act = menu.addAction(
415 self.trUtf8('List Properties'), self.__SVNListProps)
408 self.vcsMultiMenuActions.append(act) 416 self.vcsMultiMenuActions.append(act)
409 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 417 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
410 self.vcsMultiMenuActions.append(act) 418 self.vcsMultiMenuActions.append(act)
411 menu.addSeparator() 419 menu.addSeparator()
412 menu.addAction(self.trUtf8('Select all local file entries'), 420 menu.addAction(self.trUtf8('Select all local file entries'),
432 """ 440 """
433 menu = QMenu(self.trUtf8("Version Control")) 441 menu = QMenu(self.trUtf8("Version Control"))
434 442
435 act = menu.addAction( 443 act = menu.addAction(
436 UI.PixmapCache.getIcon( 444 UI.PixmapCache.getIcon(
437 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), 445 os.path.join("VcsPlugins", "vcsSubversion", "icons",
446 "subversion.png")),
438 self.vcs.vcsName(), self._VCSInfoDisplay) 447 self.vcs.vcsName(), self._VCSInfoDisplay)
439 font = act.font() 448 font = act.font()
440 font.setBold(True) 449 font.setBold(True)
441 act.setFont(font) 450 act.setFont(font)
442 menu.addSeparator() 451 menu.addSeparator()
470 479
471 menu = QMenu(self.trUtf8("Version Control")) 480 menu = QMenu(self.trUtf8("Version Control"))
472 481
473 act = menu.addAction( 482 act = menu.addAction(
474 UI.PixmapCache.getIcon( 483 UI.PixmapCache.getIcon(
475 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), 484 os.path.join("VcsPlugins", "vcsSubversion", "icons",
485 "subversion.png")),
476 self.vcs.vcsName(), self._VCSInfoDisplay) 486 self.vcs.vcsName(), self._VCSInfoDisplay)
477 font = act.font() 487 font = act.font()
478 font.setBold(True) 488 font.setBold(True)
479 act.setFont(font) 489 act.setFont(font)
480 menu.addSeparator() 490 menu.addSeparator()
535 self.trUtf8('Revert changes'), self._VCSRevert) 545 self.trUtf8('Revert changes'), self._VCSRevert)
536 self.vcsDirMenuActions.append(act) 546 self.vcsDirMenuActions.append(act)
537 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), 547 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"),
538 self.trUtf8('Merge changes'), self._VCSMerge) 548 self.trUtf8('Merge changes'), self._VCSMerge)
539 self.vcsDirMenuActions.append(act) 549 self.vcsDirMenuActions.append(act)
540 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) 550 act = menu.addAction(
551 self.trUtf8('Conflict resolved'), self.__SVNResolve)
541 self.vcsDirMenuActions.append(act) 552 self.vcsDirMenuActions.append(act)
542 menu.addSeparator() 553 menu.addSeparator()
543 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 554 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
544 self.vcsDirMenuActions.append(act) 555 self.vcsDirMenuActions.append(act)
545 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) 556 act = menu.addAction(
557 self.trUtf8('List Properties'), self.__SVNListProps)
546 self.vcsDirMenuActions.append(act) 558 self.vcsDirMenuActions.append(act)
547 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 559 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
548 self.vcsDirMenuActions.append(act) 560 self.vcsDirMenuActions.append(act)
549 menu.addSeparator() 561 menu.addSeparator()
550 menu.addAction(self.trUtf8('Select all local file entries'), 562 menu.addAction(self.trUtf8('Select all local file entries'),
576 588
577 menu = QMenu(self.trUtf8("Version Control")) 589 menu = QMenu(self.trUtf8("Version Control"))
578 590
579 act = menu.addAction( 591 act = menu.addAction(
580 UI.PixmapCache.getIcon( 592 UI.PixmapCache.getIcon(
581 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), 593 os.path.join("VcsPlugins", "vcsSubversion", "icons",
594 "subversion.png")),
582 self.vcs.vcsName(), self._VCSInfoDisplay) 595 self.vcs.vcsName(), self._VCSInfoDisplay)
583 font = act.font() 596 font = act.font()
584 font.setBold(True) 597 font.setBold(True)
585 act.setFont(font) 598 act.setFont(font)
586 menu.addSeparator() 599 menu.addSeparator()
629 self.trUtf8('Revert changes'), self._VCSRevert) 642 self.trUtf8('Revert changes'), self._VCSRevert)
630 self.vcsDirMultiMenuActions.append(act) 643 self.vcsDirMultiMenuActions.append(act)
631 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), 644 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"),
632 self.trUtf8('Merge changes'), self._VCSMerge) 645 self.trUtf8('Merge changes'), self._VCSMerge)
633 self.vcsDirMultiMenuActions.append(act) 646 self.vcsDirMultiMenuActions.append(act)
634 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) 647 act = menu.addAction(
648 self.trUtf8('Conflict resolved'), self.__SVNResolve)
635 self.vcsDirMultiMenuActions.append(act) 649 self.vcsDirMultiMenuActions.append(act)
636 menu.addSeparator() 650 menu.addSeparator()
637 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 651 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
638 self.vcsDirMultiMenuActions.append(act) 652 self.vcsDirMultiMenuActions.append(act)
639 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) 653 act = menu.addAction(
654 self.trUtf8('List Properties'), self.__SVNListProps)
640 self.vcsDirMultiMenuActions.append(act) 655 self.vcsDirMultiMenuActions.append(act)
641 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 656 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
642 self.vcsDirMultiMenuActions.append(act) 657 self.vcsDirMultiMenuActions.append(act)
643 menu.addSeparator() 658 menu.addSeparator()
644 menu.addAction(self.trUtf8('Select all local file entries'), 659 menu.addAction(self.trUtf8('Select all local file entries'),
654 669
655 mainMenu.addSeparator() 670 mainMenu.addSeparator()
656 mainMenu.addMenu(menu) 671 mainMenu.addMenu(menu)
657 self.menuDirMulti = menu 672 self.menuDirMulti = menu
658 673
659 ############################################################################ 674 ###########################################################################
660 # Menu handling methods below 675 # Menu handling methods below
661 ############################################################################ 676 ###########################################################################
662 677
663 def __SVNCopy(self): 678 def __SVNCopy(self):
664 """ 679 """
665 Private slot called by the context menu to copy the selected file. 680 Private slot called by the context menu to copy the selected file.
666 """ 681 """
701 names.append(itm.dirName()) 716 names.append(itm.dirName())
702 self.vcs.svnResolve(names) 717 self.vcs.svnResolve(names)
703 718
704 def __SVNListProps(self): 719 def __SVNListProps(self):
705 """ 720 """
706 Private slot called by the context menu to list the subversion properties of 721 Private slot called by the context menu to list the subversion
707 a file. 722 properties of a file.
708 """ 723 """
709 names = [] 724 names = []
710 for itm in self.browser.getSelectedItems(): 725 for itm in self.browser.getSelectedItems():
711 try: 726 try:
712 names.append(itm.fileName()) 727 names.append(itm.fileName())
714 names.append(itm.dirName()) 729 names.append(itm.dirName())
715 self.vcs.svnListProps(names) 730 self.vcs.svnListProps(names)
716 731
717 def __SVNSetProp(self): 732 def __SVNSetProp(self):
718 """ 733 """
719 Private slot called by the context menu to set a subversion property of a file. 734 Private slot called by the context menu to set a subversion property
735 of a file.
720 """ 736 """
721 names = [] 737 names = []
722 for itm in self.browser.getSelectedItems(): 738 for itm in self.browser.getSelectedItems():
723 try: 739 try:
724 names.append(itm.fileName()) 740 names.append(itm.fileName())
726 names.append(itm.dirName()) 742 names.append(itm.dirName())
727 self.vcs.svnSetProp(names) 743 self.vcs.svnSetProp(names)
728 744
729 def __SVNDelProp(self): 745 def __SVNDelProp(self):
730 """ 746 """
731 Private slot called by the context menu to delete a subversion property of a file. 747 Private slot called by the context menu to delete a subversion
748 property of a file.
732 """ 749 """
733 names = [] 750 names = []
734 for itm in self.browser.getSelectedItems(): 751 for itm in self.browser.getSelectedItems():
735 try: 752 try:
736 names.append(itm.fileName()) 753 names.append(itm.fileName())
738 names.append(itm.dirName()) 755 names.append(itm.dirName())
739 self.vcs.svnDelProp(names) 756 self.vcs.svnDelProp(names)
740 757
741 def __SVNExtendedDiff(self): 758 def __SVNExtendedDiff(self):
742 """ 759 """
743 Private slot called by the context menu to show the difference of a file to 760 Private slot called by the context menu to show the difference of a
744 the repository. 761 file to the repository.
745 762
746 This gives the chance to enter the revisions to compare. 763 This gives the chance to enter the revisions to compare.
747 """ 764 """
748 names = [] 765 names = []
749 for itm in self.browser.getSelectedItems(): 766 for itm in self.browser.getSelectedItems():
753 names.append(itm.dirName()) 770 names.append(itm.dirName())
754 self.vcs.svnExtendedDiff(names) 771 self.vcs.svnExtendedDiff(names)
755 772
756 def __SVNUrlDiff(self): 773 def __SVNUrlDiff(self):
757 """ 774 """
758 Private slot called by the context menu to show the difference of a file of 775 Private slot called by the context menu to show the difference of a
759 two repository URLs. 776 file of two repository URLs.
760 777
761 This gives the chance to enter the repository URLs to compare. 778 This gives the chance to enter the repository URLs to compare.
762 """ 779 """
763 names = [] 780 names = []
764 for itm in self.browser.getSelectedItems(): 781 for itm in self.browser.getSelectedItems():
768 names.append(itm.dirName()) 785 names.append(itm.dirName())
769 self.vcs.svnUrlDiff(names) 786 self.vcs.svnUrlDiff(names)
770 787
771 def __SVNSbsDiff(self): 788 def __SVNSbsDiff(self):
772 """ 789 """
773 Private slot called by the context menu to show the difference of a file to 790 Private slot called by the context menu to show the difference of a
774 the repository side-by-side. 791 file to the repository side-by-side.
775 """ 792 """
776 itm = self.browser.currentItem() 793 itm = self.browser.currentItem()
777 fn = itm.fileName() 794 fn = itm.fileName()
778 self.vcs.svnSbsDiff(fn) 795 self.vcs.svnSbsDiff(fn)
779 796
780 def __SVNSbsExtendedDiff(self): 797 def __SVNSbsExtendedDiff(self):
781 """ 798 """
782 Private slot called by the context menu to show the difference of a file to 799 Private slot called by the context menu to show the difference of a
783 the repository side-by-side allowing the selection of revisions to compare. 800 file to the repository side-by-side.
801
802 It allows the selection of revisions to compare.
784 """ 803 """
785 itm = self.browser.currentItem() 804 itm = self.browser.currentItem()
786 fn = itm.fileName() 805 fn = itm.fileName()
787 self.vcs.svnSbsDiff(fn, extended=True) 806 self.vcs.svnSbsDiff(fn, extended=True)
788 807
789 def __SVNLogBrowser(self): 808 def __SVNLogBrowser(self):
790 """ 809 """
791 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
811 a file.
792 """ 812 """
793 itm = self.browser.currentItem() 813 itm = self.browser.currentItem()
794 try: 814 try:
795 fn = itm.fileName() 815 fn = itm.fileName()
796 isFile = True 816 isFile = True
807 fn = itm.fileName() 827 fn = itm.fileName()
808 self.vcs.svnBlame(fn) 828 self.vcs.svnBlame(fn)
809 829
810 def __SVNLock(self): 830 def __SVNLock(self):
811 """ 831 """
812 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
813 """ 833 repository. """
814 names = [] 834 names = []
815 for itm in self.browser.getSelectedItems(): 835 for itm in self.browser.getSelectedItems():
816 try: 836 try:
817 names.append(itm.fileName()) 837 names.append(itm.fileName())
818 except AttributeError: 838 except AttributeError:
819 names.append(itm.dirName()) 839 names.append(itm.dirName())
820 self.vcs.svnLock(names) 840 self.vcs.svnLock(names)
821 841
822 def __SVNUnlock(self): 842 def __SVNUnlock(self):
823 """ 843 """
824 Private slot called by the context menu to unlock files in the repository. 844 Private slot called by the context menu to unlock files in the
845 repository.
825 """ 846 """
826 names = [] 847 names = []
827 for itm in self.browser.getSelectedItems(): 848 for itm in self.browser.getSelectedItems():
828 try: 849 try:
829 names.append(itm.fileName()) 850 names.append(itm.fileName())
831 names.append(itm.dirName()) 852 names.append(itm.dirName())
832 self.vcs.svnUnlock(names) 853 self.vcs.svnUnlock(names)
833 854
834 def __SVNBreakLock(self): 855 def __SVNBreakLock(self):
835 """ 856 """
836 Private slot called by the context menu to break lock files in the repository. 857 Private slot called by the context menu to break lock files in the
858 repository.
837 """ 859 """
838 names = [] 860 names = []
839 for itm in self.browser.getSelectedItems(): 861 for itm in self.browser.getSelectedItems():
840 try: 862 try:
841 names.append(itm.fileName()) 863 names.append(itm.fileName())
843 names.append(itm.dirName()) 865 names.append(itm.dirName())
844 self.vcs.svnUnlock(names, breakIt=True) 866 self.vcs.svnUnlock(names, breakIt=True)
845 867
846 def __SVNStealLock(self): 868 def __SVNStealLock(self):
847 """ 869 """
848 Private slot called by the context menu to steal lock files in the repository. 870 Private slot called by the context menu to steal lock files in the
871 repository.
849 """ 872 """
850 names = [] 873 names = []
851 for itm in self.browser.getSelectedItems(): 874 for itm in self.browser.getSelectedItems():
852 try: 875 try:
853 names.append(itm.fileName()) 876 names.append(itm.fileName())
857 880
858 def __SVNConfigure(self): 881 def __SVNConfigure(self):
859 """ 882 """
860 Private method to open the configuration dialog. 883 Private method to open the configuration dialog.
861 """ 884 """
862 e5App().getObject("UserInterface").showPreferences("zzz_subversionPage") 885 e5App().getObject("UserInterface")\
886 .showPreferences("zzz_subversionPage")
863 887
864 def __SVNAddToChangelist(self): 888 def __SVNAddToChangelist(self):
865 """ 889 """
866 Private slot called by the context menu to add files to a changelist. 890 Private slot called by the context menu to add files to a changelist.
867 """ 891 """
873 names.append(itm.dirName()) 897 names.append(itm.dirName())
874 self.vcs.svnAddToChangelist(names) 898 self.vcs.svnAddToChangelist(names)
875 899
876 def __SVNRemoveFromChangelist(self): 900 def __SVNRemoveFromChangelist(self):
877 """ 901 """
878 Private slot called by the context menu to remove files from their changelist. 902 Private slot called by the context menu to remove files from their
903 changelist.
879 """ 904 """
880 names = [] 905 names = []
881 for itm in self.browser.getSelectedItems(): 906 for itm in self.browser.getSelectedItems():
882 try: 907 try:
883 names.append(itm.fileName()) 908 names.append(itm.fileName())
884 except AttributeError: 909 except AttributeError:
885 names.append(itm.dirName()) 910 names.append(itm.dirName())
886 self.vcs.svnRemoveFromChangelist(names) 911 self.vcs.svnRemoveFromChangelist(names)
887 912
888 ############################################################################ 913 ###########################################################################
889 # Some private utility methods below 914 # Some private utility methods below
890 ############################################################################ 915 ###########################################################################
891 916
892 def __itemsHaveFiles(self, items): 917 def __itemsHaveFiles(self, items):
893 """ 918 """
894 Private method to check, if items contain file type items. 919 Private method to check, if items contain file type items.
895 920

eric ide

mercurial