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 |
196 |
197 |
197 menu = QMenu(self.trUtf8("Version Control")) |
198 menu = QMenu(self.trUtf8("Version Control")) |
198 |
199 |
199 act = menu.addAction( |
200 act = menu.addAction( |
200 UI.PixmapCache.getIcon( |
201 UI.PixmapCache.getIcon( |
201 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), |
202 os.path.join("VcsPlugins", "vcsSubversion", "icons", |
|
203 "subversion.png")), |
202 self.vcs.vcsName(), self._VCSInfoDisplay) |
204 self.vcs.vcsName(), self._VCSInfoDisplay) |
203 font = act.font() |
205 font = act.font() |
204 font.setBold(True) |
206 font.setBold(True) |
205 act.setFont(font) |
207 act.setFont(font) |
206 menu.addSeparator() |
208 menu.addSeparator() |
216 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), |
218 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), |
217 self.trUtf8('Add to repository'), |
219 self.trUtf8('Add to repository'), |
218 self._VCSAdd) |
220 self._VCSAdd) |
219 self.vcsAddMenuActions.append(act) |
221 self.vcsAddMenuActions.append(act) |
220 if 1 in self.browser.specialMenuEntries: |
222 if 1 in self.browser.specialMenuEntries: |
221 self.vcsMenuAddTree = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), |
223 self.vcsMenuAddTree = menu.addAction( |
|
224 UI.PixmapCache.getIcon("vcsAdd.png"), |
222 self.trUtf8('Add tree to repository'), |
225 self.trUtf8('Add tree to repository'), |
223 self._VCSAddTree) |
226 self._VCSAddTree) |
224 self.vcsAddMenuActions.append(self.vcsMenuAddTree) |
227 self.vcsAddMenuActions.append(self.vcsMenuAddTree) |
225 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), |
228 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), |
226 self.trUtf8('Remove from repository (and disk)'), |
229 self.trUtf8('Remove from repository (and disk)'), |
277 self.trUtf8('Revert changes'), self._VCSRevert) |
280 self.trUtf8('Revert changes'), self._VCSRevert) |
278 self.vcsMenuActions.append(act) |
281 self.vcsMenuActions.append(act) |
279 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), |
282 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), |
280 self.trUtf8('Merge changes'), self._VCSMerge) |
283 self.trUtf8('Merge changes'), self._VCSMerge) |
281 self.vcsMenuActions.append(act) |
284 self.vcsMenuActions.append(act) |
282 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) |
285 act = menu.addAction( |
|
286 self.trUtf8('Conflict resolved'), self.__SVNResolve) |
283 self.vcsMenuActions.append(act) |
287 self.vcsMenuActions.append(act) |
284 if self.vcs.version >= (1, 2, 0): |
288 if self.vcs.version >= (1, 2, 0): |
285 menu.addSeparator() |
289 menu.addSeparator() |
286 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"), |
290 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"), |
287 self.trUtf8('Lock'), self.__SVNLock) |
291 self.trUtf8('Lock'), self.__SVNLock) |
296 self.trUtf8('Steal Lock'), self.__SVNStealLock) |
300 self.trUtf8('Steal Lock'), self.__SVNStealLock) |
297 self.vcsMenuActions.append(act) |
301 self.vcsMenuActions.append(act) |
298 menu.addSeparator() |
302 menu.addSeparator() |
299 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) |
303 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) |
300 self.vcsMenuActions.append(act) |
304 self.vcsMenuActions.append(act) |
301 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) |
305 act = menu.addAction( |
|
306 self.trUtf8('List Properties'), self.__SVNListProps) |
302 self.vcsMenuActions.append(act) |
307 self.vcsMenuActions.append(act) |
303 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) |
308 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) |
304 self.vcsMenuActions.append(act) |
309 self.vcsMenuActions.append(act) |
305 menu.addSeparator() |
310 menu.addSeparator() |
306 menu.addAction(self.trUtf8('Select all local file entries'), |
311 menu.addAction(self.trUtf8('Select all local file entries'), |
330 |
335 |
331 menu = QMenu(self.trUtf8("Version Control")) |
336 menu = QMenu(self.trUtf8("Version Control")) |
332 |
337 |
333 act = menu.addAction( |
338 act = menu.addAction( |
334 UI.PixmapCache.getIcon( |
339 UI.PixmapCache.getIcon( |
335 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), |
340 os.path.join("VcsPlugins", "vcsSubversion", "icons", |
|
341 "subversion.png")), |
336 self.vcs.vcsName(), self._VCSInfoDisplay) |
342 self.vcs.vcsName(), self._VCSInfoDisplay) |
337 font = act.font() |
343 font = act.font() |
338 font.setBold(True) |
344 font.setBold(True) |
339 act.setFont(font) |
345 act.setFont(font) |
340 menu.addSeparator() |
346 menu.addSeparator() |
385 self.vcsMultiMenuActions.append(act) |
391 self.vcsMultiMenuActions.append(act) |
386 menu.addSeparator() |
392 menu.addSeparator() |
387 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"), |
393 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"), |
388 self.trUtf8('Revert changes'), self._VCSRevert) |
394 self.trUtf8('Revert changes'), self._VCSRevert) |
389 self.vcsMultiMenuActions.append(act) |
395 self.vcsMultiMenuActions.append(act) |
390 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) |
396 act = menu.addAction( |
|
397 self.trUtf8('Conflict resolved'), self.__SVNResolve) |
391 self.vcsMultiMenuActions.append(act) |
398 self.vcsMultiMenuActions.append(act) |
392 if self.vcs.version >= (1, 2, 0): |
399 if self.vcs.version >= (1, 2, 0): |
393 menu.addSeparator() |
400 menu.addSeparator() |
394 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"), |
401 act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"), |
395 self.trUtf8('Lock'), self.__SVNLock) |
402 self.trUtf8('Lock'), self.__SVNLock) |
404 self.trUtf8('Steal Lock'), self.__SVNStealLock) |
411 self.trUtf8('Steal Lock'), self.__SVNStealLock) |
405 self.vcsMultiMenuActions.append(act) |
412 self.vcsMultiMenuActions.append(act) |
406 menu.addSeparator() |
413 menu.addSeparator() |
407 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) |
414 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) |
408 self.vcsMultiMenuActions.append(act) |
415 self.vcsMultiMenuActions.append(act) |
409 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) |
416 act = menu.addAction( |
|
417 self.trUtf8('List Properties'), self.__SVNListProps) |
410 self.vcsMultiMenuActions.append(act) |
418 self.vcsMultiMenuActions.append(act) |
411 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) |
419 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) |
412 self.vcsMultiMenuActions.append(act) |
420 self.vcsMultiMenuActions.append(act) |
413 menu.addSeparator() |
421 menu.addSeparator() |
414 menu.addAction(self.trUtf8('Select all local file entries'), |
422 menu.addAction(self.trUtf8('Select all local file entries'), |
434 """ |
442 """ |
435 menu = QMenu(self.trUtf8("Version Control")) |
443 menu = QMenu(self.trUtf8("Version Control")) |
436 |
444 |
437 act = menu.addAction( |
445 act = menu.addAction( |
438 UI.PixmapCache.getIcon( |
446 UI.PixmapCache.getIcon( |
439 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), |
447 os.path.join("VcsPlugins", "vcsSubversion", "icons", |
|
448 "subversion.png")), |
440 self.vcs.vcsName(), self._VCSInfoDisplay) |
449 self.vcs.vcsName(), self._VCSInfoDisplay) |
441 font = act.font() |
450 font = act.font() |
442 font.setBold(True) |
451 font.setBold(True) |
443 act.setFont(font) |
452 act.setFont(font) |
444 menu.addSeparator() |
453 menu.addSeparator() |
472 |
481 |
473 menu = QMenu(self.trUtf8("Version Control")) |
482 menu = QMenu(self.trUtf8("Version Control")) |
474 |
483 |
475 act = menu.addAction( |
484 act = menu.addAction( |
476 UI.PixmapCache.getIcon( |
485 UI.PixmapCache.getIcon( |
477 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), |
486 os.path.join("VcsPlugins", "vcsSubversion", "icons", |
|
487 "subversion.png")), |
478 self.vcs.vcsName(), self._VCSInfoDisplay) |
488 self.vcs.vcsName(), self._VCSInfoDisplay) |
479 font = act.font() |
489 font = act.font() |
480 font.setBold(True) |
490 font.setBold(True) |
481 act.setFont(font) |
491 act.setFont(font) |
482 menu.addSeparator() |
492 menu.addSeparator() |
537 self.trUtf8('Revert changes'), self._VCSRevert) |
547 self.trUtf8('Revert changes'), self._VCSRevert) |
538 self.vcsDirMenuActions.append(act) |
548 self.vcsDirMenuActions.append(act) |
539 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), |
549 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), |
540 self.trUtf8('Merge changes'), self._VCSMerge) |
550 self.trUtf8('Merge changes'), self._VCSMerge) |
541 self.vcsDirMenuActions.append(act) |
551 self.vcsDirMenuActions.append(act) |
542 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) |
552 act = menu.addAction( |
|
553 self.trUtf8('Conflict resolved'), self.__SVNResolve) |
543 self.vcsDirMenuActions.append(act) |
554 self.vcsDirMenuActions.append(act) |
544 menu.addSeparator() |
555 menu.addSeparator() |
545 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) |
556 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) |
546 self.vcsDirMenuActions.append(act) |
557 self.vcsDirMenuActions.append(act) |
547 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) |
558 act = menu.addAction( |
|
559 self.trUtf8('List Properties'), self.__SVNListProps) |
548 self.vcsDirMenuActions.append(act) |
560 self.vcsDirMenuActions.append(act) |
549 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) |
561 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) |
550 self.vcsDirMenuActions.append(act) |
562 self.vcsDirMenuActions.append(act) |
551 menu.addSeparator() |
563 menu.addSeparator() |
552 menu.addAction(self.trUtf8('Select all local file entries'), |
564 menu.addAction(self.trUtf8('Select all local file entries'), |
578 |
590 |
579 menu = QMenu(self.trUtf8("Version Control")) |
591 menu = QMenu(self.trUtf8("Version Control")) |
580 |
592 |
581 act = menu.addAction( |
593 act = menu.addAction( |
582 UI.PixmapCache.getIcon( |
594 UI.PixmapCache.getIcon( |
583 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), |
595 os.path.join("VcsPlugins", "vcsSubversion", "icons", |
|
596 "subversion.png")), |
584 self.vcs.vcsName(), self._VCSInfoDisplay) |
597 self.vcs.vcsName(), self._VCSInfoDisplay) |
585 font = act.font() |
598 font = act.font() |
586 font.setBold(True) |
599 font.setBold(True) |
587 act.setFont(font) |
600 act.setFont(font) |
588 menu.addSeparator() |
601 menu.addSeparator() |
631 self.trUtf8('Revert changes'), self._VCSRevert) |
644 self.trUtf8('Revert changes'), self._VCSRevert) |
632 self.vcsDirMultiMenuActions.append(act) |
645 self.vcsDirMultiMenuActions.append(act) |
633 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), |
646 act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"), |
634 self.trUtf8('Merge changes'), self._VCSMerge) |
647 self.trUtf8('Merge changes'), self._VCSMerge) |
635 self.vcsDirMultiMenuActions.append(act) |
648 self.vcsDirMultiMenuActions.append(act) |
636 act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve) |
649 act = menu.addAction( |
|
650 self.trUtf8('Conflict resolved'), self.__SVNResolve) |
637 self.vcsDirMultiMenuActions.append(act) |
651 self.vcsDirMultiMenuActions.append(act) |
638 menu.addSeparator() |
652 menu.addSeparator() |
639 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) |
653 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) |
640 self.vcsDirMultiMenuActions.append(act) |
654 self.vcsDirMultiMenuActions.append(act) |
641 act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps) |
655 act = menu.addAction( |
|
656 self.trUtf8('List Properties'), self.__SVNListProps) |
642 self.vcsDirMultiMenuActions.append(act) |
657 self.vcsDirMultiMenuActions.append(act) |
643 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) |
658 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) |
644 self.vcsDirMultiMenuActions.append(act) |
659 self.vcsDirMultiMenuActions.append(act) |
645 menu.addSeparator() |
660 menu.addSeparator() |
646 menu.addAction(self.trUtf8('Select all local file entries'), |
661 menu.addAction(self.trUtf8('Select all local file entries'), |
656 |
671 |
657 mainMenu.addSeparator() |
672 mainMenu.addSeparator() |
658 mainMenu.addMenu(menu) |
673 mainMenu.addMenu(menu) |
659 self.menuDirMulti = menu |
674 self.menuDirMulti = menu |
660 |
675 |
661 ############################################################################ |
676 ########################################################################### |
662 # Menu handling methods below |
677 # Menu handling methods below |
663 ############################################################################ |
678 ########################################################################### |
664 |
679 |
665 def __SVNCopy(self): |
680 def __SVNCopy(self): |
666 """ |
681 """ |
667 Private slot called by the context menu to copy the selected file. |
682 Private slot called by the context menu to copy the selected file. |
668 """ |
683 """ |
740 names.append(itm.dirName()) |
757 names.append(itm.dirName()) |
741 self.vcs.svnDelProp(names) |
758 self.vcs.svnDelProp(names) |
742 |
759 |
743 def __SVNExtendedDiff(self): |
760 def __SVNExtendedDiff(self): |
744 """ |
761 """ |
745 Private slot called by the context menu to show the difference of a file to |
762 Private slot called by the context menu to show the difference of a |
746 the repository. |
763 file to the repository. |
747 |
764 |
748 This gives the chance to enter the revisions to compare. |
765 This gives the chance to enter the revisions to compare. |
749 """ |
766 """ |
750 names = [] |
767 names = [] |
751 for itm in self.browser.getSelectedItems(): |
768 for itm in self.browser.getSelectedItems(): |
755 names.append(itm.dirName()) |
772 names.append(itm.dirName()) |
756 self.vcs.svnExtendedDiff(names) |
773 self.vcs.svnExtendedDiff(names) |
757 |
774 |
758 def __SVNUrlDiff(self): |
775 def __SVNUrlDiff(self): |
759 """ |
776 """ |
760 Private slot called by the context menu to show the difference of a file of |
777 Private slot called by the context menu to show the difference of a |
761 two repository URLs. |
778 file of two repository URLs. |
762 |
779 |
763 This gives the chance to enter the repository URLs to compare. |
780 This gives the chance to enter the repository URLs to compare. |
764 """ |
781 """ |
765 names = [] |
782 names = [] |
766 for itm in self.browser.getSelectedItems(): |
783 for itm in self.browser.getSelectedItems(): |
770 names.append(itm.dirName()) |
787 names.append(itm.dirName()) |
771 self.vcs.svnUrlDiff(names) |
788 self.vcs.svnUrlDiff(names) |
772 |
789 |
773 def __SVNSbsDiff(self): |
790 def __SVNSbsDiff(self): |
774 """ |
791 """ |
775 Private slot called by the context menu to show the difference of a file to |
792 Private slot called by the context menu to show the difference of a |
776 the repository side-by-side. |
793 file to the repository side-by-side. |
777 """ |
794 """ |
778 itm = self.browser.currentItem() |
795 itm = self.browser.currentItem() |
779 fn = itm.fileName() |
796 fn = itm.fileName() |
780 self.vcs.svnSbsDiff(fn) |
797 self.vcs.svnSbsDiff(fn) |
781 |
798 |
782 def __SVNSbsExtendedDiff(self): |
799 def __SVNSbsExtendedDiff(self): |
783 """ |
800 """ |
784 Private slot called by the context menu to show the difference of a file to |
801 Private slot called by the context menu to show the difference of a |
785 the repository side-by-side allowing the selection of revisions to compare. |
802 file to the repository side-by-side. |
|
803 |
|
804 It allows the selection of revisions to compare. |
786 """ |
805 """ |
787 itm = self.browser.currentItem() |
806 itm = self.browser.currentItem() |
788 fn = itm.fileName() |
807 fn = itm.fileName() |
789 self.vcs.svnSbsDiff(fn, extended=True) |
808 self.vcs.svnSbsDiff(fn, extended=True) |
790 |
809 |
791 def __SVNLogBrowser(self): |
810 def __SVNLogBrowser(self): |
792 """ |
811 """ |
793 Private slot called by the context menu to show the log browser for a file. |
812 Private slot called by the context menu to show the log browser for |
|
813 a file. |
794 """ |
814 """ |
795 itm = self.browser.currentItem() |
815 itm = self.browser.currentItem() |
796 try: |
816 try: |
797 fn = itm.fileName() |
817 fn = itm.fileName() |
798 isFile = True |
818 isFile = True |
809 fn = itm.fileName() |
829 fn = itm.fileName() |
810 self.vcs.svnBlame(fn) |
830 self.vcs.svnBlame(fn) |
811 |
831 |
812 def __SVNLock(self): |
832 def __SVNLock(self): |
813 """ |
833 """ |
814 Private slot called by the context menu to lock files in the repository. |
834 Private slot called by the context menu to lock files in the |
815 """ |
835 repository. """ |
816 names = [] |
836 names = [] |
817 for itm in self.browser.getSelectedItems(): |
837 for itm in self.browser.getSelectedItems(): |
818 try: |
838 try: |
819 names.append(itm.fileName()) |
839 names.append(itm.fileName()) |
820 except AttributeError: |
840 except AttributeError: |
821 names.append(itm.dirName()) |
841 names.append(itm.dirName()) |
822 self.vcs.svnLock(names) |
842 self.vcs.svnLock(names) |
823 |
843 |
824 def __SVNUnlock(self): |
844 def __SVNUnlock(self): |
825 """ |
845 """ |
826 Private slot called by the context menu to unlock files in the repository. |
846 Private slot called by the context menu to unlock files in the |
|
847 repository. |
827 """ |
848 """ |
828 names = [] |
849 names = [] |
829 for itm in self.browser.getSelectedItems(): |
850 for itm in self.browser.getSelectedItems(): |
830 try: |
851 try: |
831 names.append(itm.fileName()) |
852 names.append(itm.fileName()) |
845 names.append(itm.dirName()) |
867 names.append(itm.dirName()) |
846 self.vcs.svnUnlock(names, breakIt=True) |
868 self.vcs.svnUnlock(names, breakIt=True) |
847 |
869 |
848 def __SVNStealLock(self): |
870 def __SVNStealLock(self): |
849 """ |
871 """ |
850 Private slot called by the context menu to steal lock files in the repository. |
872 Private slot called by the context menu to steal lock files in the |
|
873 repository. |
851 """ |
874 """ |
852 names = [] |
875 names = [] |
853 for itm in self.browser.getSelectedItems(): |
876 for itm in self.browser.getSelectedItems(): |
854 try: |
877 try: |
855 names.append(itm.fileName()) |
878 names.append(itm.fileName()) |
875 names.append(itm.dirName()) |
899 names.append(itm.dirName()) |
876 self.vcs.svnAddToChangelist(names) |
900 self.vcs.svnAddToChangelist(names) |
877 |
901 |
878 def __SVNRemoveFromChangelist(self): |
902 def __SVNRemoveFromChangelist(self): |
879 """ |
903 """ |
880 Private slot called by the context menu to remove files from their changelist. |
904 Private slot called by the context menu to remove files from their |
|
905 changelist. |
881 """ |
906 """ |
882 names = [] |
907 names = [] |
883 for itm in self.browser.getSelectedItems(): |
908 for itm in self.browser.getSelectedItems(): |
884 try: |
909 try: |
885 names.append(itm.fileName()) |
910 names.append(itm.fileName()) |
886 except AttributeError: |
911 except AttributeError: |
887 names.append(itm.dirName()) |
912 names.append(itm.dirName()) |
888 self.vcs.svnRemoveFromChangelist(names) |
913 self.vcs.svnRemoveFromChangelist(names) |
889 |
914 |
890 ############################################################################ |
915 ########################################################################### |
891 # Some private utility methods below |
916 # Some private utility methods below |
892 ############################################################################ |
917 ########################################################################### |
893 |
918 |
894 def __itemsHaveFiles(self, items): |
919 def __itemsHaveFiles(self, items): |
895 """ |
920 """ |
896 Private method to check, if items contain file type items. |
921 Private method to check, if items contain file type items. |
897 |
922 |