src/eric7/Plugins/VcsPlugins/vcsSubversion/ProjectBrowserHelper.py

branch
eric7
changeset 9413
80c06d472826
parent 9221
bf71ee032bb4
child 9473
3f23dbf37dbe
equal deleted inserted replaced
9412:45e7bb09c120 9413:80c06d472826
8 """ 8 """
9 9
10 import os 10 import os
11 from PyQt6.QtWidgets import QMenu 11 from PyQt6.QtWidgets import QMenu
12 12
13 from EricWidgets.EricApplication import ericApp 13 from eric7.EricWidgets.EricApplication import ericApp
14 14
15 from VCS.ProjectBrowserHelper import VcsProjectBrowserHelper 15 from eric7.VCS.ProjectBrowserHelper import VcsProjectBrowserHelper
16 16
17 from Project.ProjectBrowserModel import ProjectBrowserFileItem 17 from eric7.Project.ProjectBrowserModel import ProjectBrowserFileItem
18 18
19 import UI.PixmapCache 19 from eric7.EricGui import EricPixmapCache
20 20
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.
208 self.vcsAddMenuActions = [] 208 self.vcsAddMenuActions = []
209 209
210 menu = QMenu(self.tr("Version Control")) 210 menu = QMenu(self.tr("Version Control"))
211 211
212 act = menu.addAction( 212 act = menu.addAction(
213 UI.PixmapCache.getIcon( 213 EricPixmapCache.getIcon(
214 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg") 214 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg")
215 ), 215 ),
216 self.vcs.vcsName(), 216 self.vcs.vcsName(),
217 self._VCSInfoDisplay, 217 self._VCSInfoDisplay,
218 ) 218 )
220 font.setBold(True) 220 font.setBold(True)
221 act.setFont(font) 221 act.setFont(font)
222 menu.addSeparator() 222 menu.addSeparator()
223 223
224 act = menu.addAction( 224 act = menu.addAction(
225 UI.PixmapCache.getIcon("vcsUpdate"), 225 EricPixmapCache.getIcon("vcsUpdate"),
226 self.tr("Update from repository"), 226 self.tr("Update from repository"),
227 self._VCSUpdate, 227 self._VCSUpdate,
228 ) 228 )
229 self.vcsMenuActions.append(act) 229 self.vcsMenuActions.append(act)
230 act = menu.addAction( 230 act = menu.addAction(
231 UI.PixmapCache.getIcon("vcsCommit"), 231 EricPixmapCache.getIcon("vcsCommit"),
232 self.tr("Commit changes to repository..."), 232 self.tr("Commit changes to repository..."),
233 self._VCSCommit, 233 self._VCSCommit,
234 ) 234 )
235 self.vcsMenuActions.append(act) 235 self.vcsMenuActions.append(act)
236 menu.addSeparator() 236 menu.addSeparator()
237 act = menu.addAction( 237 act = menu.addAction(
238 UI.PixmapCache.getIcon("vcsAdd"), self.tr("Add to repository"), self._VCSAdd 238 EricPixmapCache.getIcon("vcsAdd"),
239 self.tr("Add to repository"),
240 self._VCSAdd,
239 ) 241 )
240 self.vcsAddMenuActions.append(act) 242 self.vcsAddMenuActions.append(act)
241 if 1 in self.browser.specialMenuEntries: 243 if 1 in self.browser.specialMenuEntries:
242 self.vcsMenuAddTree = menu.addAction( 244 self.vcsMenuAddTree = menu.addAction(
243 UI.PixmapCache.getIcon("vcsAdd"), 245 EricPixmapCache.getIcon("vcsAdd"),
244 self.tr("Add tree to repository"), 246 self.tr("Add tree to repository"),
245 self._VCSAddTree, 247 self._VCSAddTree,
246 ) 248 )
247 self.vcsAddMenuActions.append(self.vcsMenuAddTree) 249 self.vcsAddMenuActions.append(self.vcsMenuAddTree)
248 act = menu.addAction( 250 act = menu.addAction(
249 UI.PixmapCache.getIcon("vcsRemove"), 251 EricPixmapCache.getIcon("vcsRemove"),
250 self.tr("Remove from repository (and disk)"), 252 self.tr("Remove from repository (and disk)"),
251 self._VCSRemove, 253 self._VCSRemove,
252 ) 254 )
253 self.vcsMenuActions.append(act) 255 self.vcsMenuActions.append(act)
254 menu.addSeparator() 256 menu.addSeparator()
266 self.tr("Remove from Changelist"), self.__SVNRemoveFromChangelist 268 self.tr("Remove from Changelist"), self.__SVNRemoveFromChangelist
267 ) 269 )
268 self.vcsMenuActions.append(act) 270 self.vcsMenuActions.append(act)
269 menu.addSeparator() 271 menu.addSeparator()
270 act = menu.addAction( 272 act = menu.addAction(
271 UI.PixmapCache.getIcon("vcsLog"), 273 EricPixmapCache.getIcon("vcsLog"),
272 self.tr("Show log browser"), 274 self.tr("Show log browser"),
273 self._VCSLogBrowser, 275 self._VCSLogBrowser,
274 ) 276 )
275 self.vcsMenuActions.append(act) 277 self.vcsMenuActions.append(act)
276 menu.addSeparator() 278 menu.addSeparator()
277 act = menu.addAction( 279 act = menu.addAction(
278 UI.PixmapCache.getIcon("vcsStatus"), self.tr("Show status"), self._VCSStatus 280 EricPixmapCache.getIcon("vcsStatus"),
279 ) 281 self.tr("Show status"),
280 self.vcsMenuActions.append(act) 282 self._VCSStatus,
281 menu.addSeparator() 283 )
282 act = menu.addAction( 284 self.vcsMenuActions.append(act)
283 UI.PixmapCache.getIcon("vcsDiff"), 285 menu.addSeparator()
286 act = menu.addAction(
287 EricPixmapCache.getIcon("vcsDiff"),
284 self.tr("Show differences"), 288 self.tr("Show differences"),
285 self._VCSDiff, 289 self._VCSDiff,
286 ) 290 )
287 self.vcsMenuActions.append(act) 291 self.vcsMenuActions.append(act)
288 act = menu.addAction( 292 act = menu.addAction(
289 UI.PixmapCache.getIcon("vcsSbsDiff"), 293 EricPixmapCache.getIcon("vcsSbsDiff"),
290 self.tr("Show differences side-by-side"), 294 self.tr("Show differences side-by-side"),
291 self.__SVNSbsDiff, 295 self.__SVNSbsDiff,
292 ) 296 )
293 self.vcsMenuActions.append(act) 297 self.vcsMenuActions.append(act)
294 act = menu.addAction( 298 act = menu.addAction(
295 UI.PixmapCache.getIcon("vcsDiff"), 299 EricPixmapCache.getIcon("vcsDiff"),
296 self.tr("Show differences (extended)"), 300 self.tr("Show differences (extended)"),
297 self.__SVNExtendedDiff, 301 self.__SVNExtendedDiff,
298 ) 302 )
299 self.vcsMenuActions.append(act) 303 self.vcsMenuActions.append(act)
300 act = menu.addAction( 304 act = menu.addAction(
301 UI.PixmapCache.getIcon("vcsSbsDiff"), 305 EricPixmapCache.getIcon("vcsSbsDiff"),
302 self.tr("Show differences side-by-side (extended)"), 306 self.tr("Show differences side-by-side (extended)"),
303 self.__SVNSbsExtendedDiff, 307 self.__SVNSbsExtendedDiff,
304 ) 308 )
305 self.vcsMenuActions.append(act) 309 self.vcsMenuActions.append(act)
306 act = menu.addAction( 310 act = menu.addAction(
307 UI.PixmapCache.getIcon("vcsDiff"), 311 EricPixmapCache.getIcon("vcsDiff"),
308 self.tr("Show differences (URLs)"), 312 self.tr("Show differences (URLs)"),
309 self.__SVNUrlDiff, 313 self.__SVNUrlDiff,
310 ) 314 )
311 self.vcsMenuActions.append(act) 315 self.vcsMenuActions.append(act)
312 self.blameAct = menu.addAction(self.tr("Show annotated file"), self.__SVNBlame) 316 self.blameAct = menu.addAction(self.tr("Show annotated file"), self.__SVNBlame)
313 self.vcsMenuActions.append(self.blameAct) 317 self.vcsMenuActions.append(self.blameAct)
314 menu.addSeparator() 318 menu.addSeparator()
315 act = menu.addAction( 319 act = menu.addAction(
316 UI.PixmapCache.getIcon("vcsRevert"), 320 EricPixmapCache.getIcon("vcsRevert"),
317 self.tr("Revert changes"), 321 self.tr("Revert changes"),
318 self._VCSRevert, 322 self._VCSRevert,
319 ) 323 )
320 self.vcsMenuActions.append(act) 324 self.vcsMenuActions.append(act)
321 act = menu.addAction( 325 act = menu.addAction(
322 UI.PixmapCache.getIcon("vcsMerge"), self.tr("Merge changes"), self._VCSMerge 326 EricPixmapCache.getIcon("vcsMerge"),
327 self.tr("Merge changes"),
328 self._VCSMerge,
323 ) 329 )
324 self.vcsMenuActions.append(act) 330 self.vcsMenuActions.append(act)
325 act = menu.addAction(self.tr("Conflicts resolved"), self.__SVNResolve) 331 act = menu.addAction(self.tr("Conflicts resolved"), self.__SVNResolve)
326 self.vcsMenuActions.append(act) 332 self.vcsMenuActions.append(act)
327 if self.vcs.version >= (1, 2, 0): 333 if self.vcs.version >= (1, 2, 0):
328 menu.addSeparator() 334 menu.addSeparator()
329 act = menu.addAction( 335 act = menu.addAction(
330 UI.PixmapCache.getIcon("vcsLock"), self.tr("Lock"), self.__SVNLock 336 EricPixmapCache.getIcon("vcsLock"), self.tr("Lock"), self.__SVNLock
331 ) 337 )
332 self.vcsMenuActions.append(act) 338 self.vcsMenuActions.append(act)
333 act = menu.addAction( 339 act = menu.addAction(
334 UI.PixmapCache.getIcon("vcsUnlock"), self.tr("Unlock"), self.__SVNUnlock 340 EricPixmapCache.getIcon("vcsUnlock"),
335 ) 341 self.tr("Unlock"),
336 self.vcsMenuActions.append(act) 342 self.__SVNUnlock,
337 act = menu.addAction( 343 )
338 UI.PixmapCache.getIcon("vcsUnlock"), 344 self.vcsMenuActions.append(act)
345 act = menu.addAction(
346 EricPixmapCache.getIcon("vcsUnlock"),
339 self.tr("Break Lock"), 347 self.tr("Break Lock"),
340 self.__SVNBreakLock, 348 self.__SVNBreakLock,
341 ) 349 )
342 self.vcsMenuActions.append(act) 350 self.vcsMenuActions.append(act)
343 act = menu.addAction( 351 act = menu.addAction(
344 UI.PixmapCache.getIcon("vcsUnlock"), 352 EricPixmapCache.getIcon("vcsUnlock"),
345 self.tr("Steal Lock"), 353 self.tr("Steal Lock"),
346 self.__SVNStealLock, 354 self.__SVNStealLock,
347 ) 355 )
348 self.vcsMenuActions.append(act) 356 self.vcsMenuActions.append(act)
349 menu.addSeparator() 357 menu.addSeparator()
386 self.vcsAddMultiMenuActions = [] 394 self.vcsAddMultiMenuActions = []
387 395
388 menu = QMenu(self.tr("Version Control")) 396 menu = QMenu(self.tr("Version Control"))
389 397
390 act = menu.addAction( 398 act = menu.addAction(
391 UI.PixmapCache.getIcon( 399 EricPixmapCache.getIcon(
392 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg") 400 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg")
393 ), 401 ),
394 self.vcs.vcsName(), 402 self.vcs.vcsName(),
395 self._VCSInfoDisplay, 403 self._VCSInfoDisplay,
396 ) 404 )
398 font.setBold(True) 406 font.setBold(True)
399 act.setFont(font) 407 act.setFont(font)
400 menu.addSeparator() 408 menu.addSeparator()
401 409
402 act = menu.addAction( 410 act = menu.addAction(
403 UI.PixmapCache.getIcon("vcsUpdate"), 411 EricPixmapCache.getIcon("vcsUpdate"),
404 self.tr("Update from repository"), 412 self.tr("Update from repository"),
405 self._VCSUpdate, 413 self._VCSUpdate,
406 ) 414 )
407 self.vcsMultiMenuActions.append(act) 415 self.vcsMultiMenuActions.append(act)
408 act = menu.addAction( 416 act = menu.addAction(
409 UI.PixmapCache.getIcon("vcsCommit"), 417 EricPixmapCache.getIcon("vcsCommit"),
410 self.tr("Commit changes to repository..."), 418 self.tr("Commit changes to repository..."),
411 self._VCSCommit, 419 self._VCSCommit,
412 ) 420 )
413 self.vcsMultiMenuActions.append(act) 421 self.vcsMultiMenuActions.append(act)
414 menu.addSeparator() 422 menu.addSeparator()
415 act = menu.addAction( 423 act = menu.addAction(
416 UI.PixmapCache.getIcon("vcsAdd"), self.tr("Add to repository"), self._VCSAdd 424 EricPixmapCache.getIcon("vcsAdd"),
425 self.tr("Add to repository"),
426 self._VCSAdd,
417 ) 427 )
418 self.vcsAddMultiMenuActions.append(act) 428 self.vcsAddMultiMenuActions.append(act)
419 if 1 in self.browser.specialMenuEntries: 429 if 1 in self.browser.specialMenuEntries:
420 self.vcsMultiMenuAddTree = menu.addAction( 430 self.vcsMultiMenuAddTree = menu.addAction(
421 UI.PixmapCache.getIcon("vcsAdd"), 431 EricPixmapCache.getIcon("vcsAdd"),
422 self.tr("Add tree to repository"), 432 self.tr("Add tree to repository"),
423 self._VCSAddTree, 433 self._VCSAddTree,
424 ) 434 )
425 self.vcsAddMultiMenuActions.append(self.vcsMultiMenuAddTree) 435 self.vcsAddMultiMenuActions.append(self.vcsMultiMenuAddTree)
426 act = menu.addAction( 436 act = menu.addAction(
427 UI.PixmapCache.getIcon("vcsRemove"), 437 EricPixmapCache.getIcon("vcsRemove"),
428 self.tr("Remove from repository (and disk)"), 438 self.tr("Remove from repository (and disk)"),
429 self._VCSRemove, 439 self._VCSRemove,
430 ) 440 )
431 self.vcsMultiMenuActions.append(act) 441 self.vcsMultiMenuActions.append(act)
432 if self.vcs.version >= (1, 5, 0): 442 if self.vcs.version >= (1, 5, 0):
439 self.tr("Remove from Changelist"), self.__SVNRemoveFromChangelist 449 self.tr("Remove from Changelist"), self.__SVNRemoveFromChangelist
440 ) 450 )
441 self.vcsMenuActions.append(act) 451 self.vcsMenuActions.append(act)
442 menu.addSeparator() 452 menu.addSeparator()
443 act = menu.addAction( 453 act = menu.addAction(
444 UI.PixmapCache.getIcon("vcsStatus"), self.tr("Show status"), self._VCSStatus 454 EricPixmapCache.getIcon("vcsStatus"),
445 ) 455 self.tr("Show status"),
446 self.vcsMultiMenuActions.append(act) 456 self._VCSStatus,
447 menu.addSeparator() 457 )
448 act = menu.addAction( 458 self.vcsMultiMenuActions.append(act)
449 UI.PixmapCache.getIcon("vcsDiff"), 459 menu.addSeparator()
460 act = menu.addAction(
461 EricPixmapCache.getIcon("vcsDiff"),
450 self.tr("Show differences"), 462 self.tr("Show differences"),
451 self._VCSDiff, 463 self._VCSDiff,
452 ) 464 )
453 self.vcsMultiMenuActions.append(act) 465 self.vcsMultiMenuActions.append(act)
454 act = menu.addAction( 466 act = menu.addAction(
455 UI.PixmapCache.getIcon("vcsDiff"), 467 EricPixmapCache.getIcon("vcsDiff"),
456 self.tr("Show differences (extended)"), 468 self.tr("Show differences (extended)"),
457 self.__SVNExtendedDiff, 469 self.__SVNExtendedDiff,
458 ) 470 )
459 self.vcsMultiMenuActions.append(act) 471 self.vcsMultiMenuActions.append(act)
460 act = menu.addAction( 472 act = menu.addAction(
461 UI.PixmapCache.getIcon("vcsDiff"), 473 EricPixmapCache.getIcon("vcsDiff"),
462 self.tr("Show differences (URLs)"), 474 self.tr("Show differences (URLs)"),
463 self.__SVNUrlDiff, 475 self.__SVNUrlDiff,
464 ) 476 )
465 self.vcsMultiMenuActions.append(act) 477 self.vcsMultiMenuActions.append(act)
466 menu.addSeparator() 478 menu.addSeparator()
467 act = menu.addAction( 479 act = menu.addAction(
468 UI.PixmapCache.getIcon("vcsRevert"), 480 EricPixmapCache.getIcon("vcsRevert"),
469 self.tr("Revert changes"), 481 self.tr("Revert changes"),
470 self._VCSRevert, 482 self._VCSRevert,
471 ) 483 )
472 self.vcsMultiMenuActions.append(act) 484 self.vcsMultiMenuActions.append(act)
473 act = menu.addAction(self.tr("Conflicts resolved"), self.__SVNResolve) 485 act = menu.addAction(self.tr("Conflicts resolved"), self.__SVNResolve)
474 self.vcsMultiMenuActions.append(act) 486 self.vcsMultiMenuActions.append(act)
475 if self.vcs.version >= (1, 2, 0): 487 if self.vcs.version >= (1, 2, 0):
476 menu.addSeparator() 488 menu.addSeparator()
477 act = menu.addAction( 489 act = menu.addAction(
478 UI.PixmapCache.getIcon("vcsLock"), self.tr("Lock"), self.__SVNLock 490 EricPixmapCache.getIcon("vcsLock"), self.tr("Lock"), self.__SVNLock
479 ) 491 )
480 self.vcsMultiMenuActions.append(act) 492 self.vcsMultiMenuActions.append(act)
481 act = menu.addAction( 493 act = menu.addAction(
482 UI.PixmapCache.getIcon("vcsUnlock"), self.tr("Unlock"), self.__SVNUnlock 494 EricPixmapCache.getIcon("vcsUnlock"),
495 self.tr("Unlock"),
496 self.__SVNUnlock,
483 ) 497 )
484 self.vcsMultiMenuActions.append(act) 498 self.vcsMultiMenuActions.append(act)
485 act = menu.addAction( 499 act = menu.addAction(
486 UI.PixmapCache.getIcon("vcsUnlock"), 500 EricPixmapCache.getIcon("vcsUnlock"),
487 self.tr("Break Lock"), 501 self.tr("Break Lock"),
488 self.__SVNBreakLock, 502 self.__SVNBreakLock,
489 ) 503 )
490 self.vcsMultiMenuActions.append(act) 504 self.vcsMultiMenuActions.append(act)
491 act = menu.addAction( 505 act = menu.addAction(
492 UI.PixmapCache.getIcon("vcsUnlock"), 506 EricPixmapCache.getIcon("vcsUnlock"),
493 self.tr("Steal Lock"), 507 self.tr("Steal Lock"),
494 self.__SVNStealLock, 508 self.__SVNStealLock,
495 ) 509 )
496 self.vcsMultiMenuActions.append(act) 510 self.vcsMultiMenuActions.append(act)
497 menu.addSeparator() 511 menu.addSeparator()
530 @param mainMenu reference to the menu to be amended 544 @param mainMenu reference to the menu to be amended
531 """ 545 """
532 menu = QMenu(self.tr("Version Control")) 546 menu = QMenu(self.tr("Version Control"))
533 547
534 act = menu.addAction( 548 act = menu.addAction(
535 UI.PixmapCache.getIcon( 549 EricPixmapCache.getIcon(
536 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg") 550 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg")
537 ), 551 ),
538 self.vcs.vcsName(), 552 self.vcs.vcsName(),
539 self._VCSInfoDisplay, 553 self._VCSInfoDisplay,
540 ) 554 )
577 self.vcsAddDirMenuActions = [] 591 self.vcsAddDirMenuActions = []
578 592
579 menu = QMenu(self.tr("Version Control")) 593 menu = QMenu(self.tr("Version Control"))
580 594
581 act = menu.addAction( 595 act = menu.addAction(
582 UI.PixmapCache.getIcon( 596 EricPixmapCache.getIcon(
583 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg") 597 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg")
584 ), 598 ),
585 self.vcs.vcsName(), 599 self.vcs.vcsName(),
586 self._VCSInfoDisplay, 600 self._VCSInfoDisplay,
587 ) 601 )
589 font.setBold(True) 603 font.setBold(True)
590 act.setFont(font) 604 act.setFont(font)
591 menu.addSeparator() 605 menu.addSeparator()
592 606
593 act = menu.addAction( 607 act = menu.addAction(
594 UI.PixmapCache.getIcon("vcsUpdate"), 608 EricPixmapCache.getIcon("vcsUpdate"),
595 self.tr("Update from repository"), 609 self.tr("Update from repository"),
596 self._VCSUpdate, 610 self._VCSUpdate,
597 ) 611 )
598 self.vcsDirMenuActions.append(act) 612 self.vcsDirMenuActions.append(act)
599 act = menu.addAction( 613 act = menu.addAction(
600 UI.PixmapCache.getIcon("vcsCommit"), 614 EricPixmapCache.getIcon("vcsCommit"),
601 self.tr("Commit changes to repository..."), 615 self.tr("Commit changes to repository..."),
602 self._VCSCommit, 616 self._VCSCommit,
603 ) 617 )
604 self.vcsDirMenuActions.append(act) 618 self.vcsDirMenuActions.append(act)
605 menu.addSeparator() 619 menu.addSeparator()
606 act = menu.addAction( 620 act = menu.addAction(
607 UI.PixmapCache.getIcon("vcsAdd"), self.tr("Add to repository"), self._VCSAdd 621 EricPixmapCache.getIcon("vcsAdd"),
622 self.tr("Add to repository"),
623 self._VCSAdd,
608 ) 624 )
609 self.vcsAddDirMenuActions.append(act) 625 self.vcsAddDirMenuActions.append(act)
610 act = menu.addAction( 626 act = menu.addAction(
611 UI.PixmapCache.getIcon("vcsRemove"), 627 EricPixmapCache.getIcon("vcsRemove"),
612 self.tr("Remove from repository (and disk)"), 628 self.tr("Remove from repository (and disk)"),
613 self._VCSRemove, 629 self._VCSRemove,
614 ) 630 )
615 self.vcsDirMenuActions.append(act) 631 self.vcsDirMenuActions.append(act)
616 menu.addSeparator() 632 menu.addSeparator()
628 self.tr("Remove from Changelist"), self.__SVNRemoveFromChangelist 644 self.tr("Remove from Changelist"), self.__SVNRemoveFromChangelist
629 ) 645 )
630 self.vcsMenuActions.append(act) 646 self.vcsMenuActions.append(act)
631 menu.addSeparator() 647 menu.addSeparator()
632 act = menu.addAction( 648 act = menu.addAction(
633 UI.PixmapCache.getIcon("vcsLog"), 649 EricPixmapCache.getIcon("vcsLog"),
634 self.tr("Show log browser"), 650 self.tr("Show log browser"),
635 self._VCSLogBrowser, 651 self._VCSLogBrowser,
636 ) 652 )
637 self.vcsDirMenuActions.append(act) 653 self.vcsDirMenuActions.append(act)
638 menu.addSeparator() 654 menu.addSeparator()
639 act = menu.addAction( 655 act = menu.addAction(
640 UI.PixmapCache.getIcon("vcsStatus"), self.tr("Show status"), self._VCSStatus 656 EricPixmapCache.getIcon("vcsStatus"),
641 ) 657 self.tr("Show status"),
642 self.vcsDirMenuActions.append(act) 658 self._VCSStatus,
643 menu.addSeparator() 659 )
644 act = menu.addAction( 660 self.vcsDirMenuActions.append(act)
645 UI.PixmapCache.getIcon("vcsDiff"), 661 menu.addSeparator()
662 act = menu.addAction(
663 EricPixmapCache.getIcon("vcsDiff"),
646 self.tr("Show differences"), 664 self.tr("Show differences"),
647 self._VCSDiff, 665 self._VCSDiff,
648 ) 666 )
649 self.vcsDirMenuActions.append(act) 667 self.vcsDirMenuActions.append(act)
650 act = menu.addAction( 668 act = menu.addAction(
651 UI.PixmapCache.getIcon("vcsDiff"), 669 EricPixmapCache.getIcon("vcsDiff"),
652 self.tr("Show differences (extended)"), 670 self.tr("Show differences (extended)"),
653 self.__SVNExtendedDiff, 671 self.__SVNExtendedDiff,
654 ) 672 )
655 self.vcsDirMenuActions.append(act) 673 self.vcsDirMenuActions.append(act)
656 act = menu.addAction( 674 act = menu.addAction(
657 UI.PixmapCache.getIcon("vcsDiff"), 675 EricPixmapCache.getIcon("vcsDiff"),
658 self.tr("Show differences (URLs)"), 676 self.tr("Show differences (URLs)"),
659 self.__SVNUrlDiff, 677 self.__SVNUrlDiff,
660 ) 678 )
661 self.vcsDirMenuActions.append(act) 679 self.vcsDirMenuActions.append(act)
662 menu.addSeparator() 680 menu.addSeparator()
663 act = menu.addAction( 681 act = menu.addAction(
664 UI.PixmapCache.getIcon("vcsRevert"), 682 EricPixmapCache.getIcon("vcsRevert"),
665 self.tr("Revert changes"), 683 self.tr("Revert changes"),
666 self._VCSRevert, 684 self._VCSRevert,
667 ) 685 )
668 self.vcsDirMenuActions.append(act) 686 self.vcsDirMenuActions.append(act)
669 act = menu.addAction( 687 act = menu.addAction(
670 UI.PixmapCache.getIcon("vcsMerge"), self.tr("Merge changes"), self._VCSMerge 688 EricPixmapCache.getIcon("vcsMerge"),
689 self.tr("Merge changes"),
690 self._VCSMerge,
671 ) 691 )
672 self.vcsDirMenuActions.append(act) 692 self.vcsDirMenuActions.append(act)
673 act = menu.addAction(self.tr("Conflicts resolved"), self.__SVNResolve) 693 act = menu.addAction(self.tr("Conflicts resolved"), self.__SVNResolve)
674 self.vcsDirMenuActions.append(act) 694 self.vcsDirMenuActions.append(act)
675 menu.addSeparator() 695 menu.addSeparator()
714 self.vcsAddDirMultiMenuActions = [] 734 self.vcsAddDirMultiMenuActions = []
715 735
716 menu = QMenu(self.tr("Version Control")) 736 menu = QMenu(self.tr("Version Control"))
717 737
718 act = menu.addAction( 738 act = menu.addAction(
719 UI.PixmapCache.getIcon( 739 EricPixmapCache.getIcon(
720 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg") 740 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg")
721 ), 741 ),
722 self.vcs.vcsName(), 742 self.vcs.vcsName(),
723 self._VCSInfoDisplay, 743 self._VCSInfoDisplay,
724 ) 744 )
726 font.setBold(True) 746 font.setBold(True)
727 act.setFont(font) 747 act.setFont(font)
728 menu.addSeparator() 748 menu.addSeparator()
729 749
730 act = menu.addAction( 750 act = menu.addAction(
731 UI.PixmapCache.getIcon("vcsUpdate"), 751 EricPixmapCache.getIcon("vcsUpdate"),
732 self.tr("Update from repository"), 752 self.tr("Update from repository"),
733 self._VCSUpdate, 753 self._VCSUpdate,
734 ) 754 )
735 self.vcsDirMultiMenuActions.append(act) 755 self.vcsDirMultiMenuActions.append(act)
736 act = menu.addAction( 756 act = menu.addAction(
737 UI.PixmapCache.getIcon("vcsCommit"), 757 EricPixmapCache.getIcon("vcsCommit"),
738 self.tr("Commit changes to repository..."), 758 self.tr("Commit changes to repository..."),
739 self._VCSCommit, 759 self._VCSCommit,
740 ) 760 )
741 self.vcsDirMultiMenuActions.append(act) 761 self.vcsDirMultiMenuActions.append(act)
742 menu.addSeparator() 762 menu.addSeparator()
743 act = menu.addAction( 763 act = menu.addAction(
744 UI.PixmapCache.getIcon("vcsAdd"), self.tr("Add to repository"), self._VCSAdd 764 EricPixmapCache.getIcon("vcsAdd"),
765 self.tr("Add to repository"),
766 self._VCSAdd,
745 ) 767 )
746 self.vcsAddDirMultiMenuActions.append(act) 768 self.vcsAddDirMultiMenuActions.append(act)
747 act = menu.addAction( 769 act = menu.addAction(
748 UI.PixmapCache.getIcon("vcsRemove"), 770 EricPixmapCache.getIcon("vcsRemove"),
749 self.tr("Remove from repository (and disk)"), 771 self.tr("Remove from repository (and disk)"),
750 self._VCSRemove, 772 self._VCSRemove,
751 ) 773 )
752 self.vcsDirMultiMenuActions.append(act) 774 self.vcsDirMultiMenuActions.append(act)
753 if self.vcs.version >= (1, 5, 0): 775 if self.vcs.version >= (1, 5, 0):
760 self.tr("Remove from Changelist"), self.__SVNRemoveFromChangelist 782 self.tr("Remove from Changelist"), self.__SVNRemoveFromChangelist
761 ) 783 )
762 self.vcsMenuActions.append(act) 784 self.vcsMenuActions.append(act)
763 menu.addSeparator() 785 menu.addSeparator()
764 act = menu.addAction( 786 act = menu.addAction(
765 UI.PixmapCache.getIcon("vcsStatus"), self.tr("Show status"), self._VCSStatus 787 EricPixmapCache.getIcon("vcsStatus"),
766 ) 788 self.tr("Show status"),
767 self.vcsDirMultiMenuActions.append(act) 789 self._VCSStatus,
768 menu.addSeparator() 790 )
769 act = menu.addAction( 791 self.vcsDirMultiMenuActions.append(act)
770 UI.PixmapCache.getIcon("vcsDiff"), 792 menu.addSeparator()
793 act = menu.addAction(
794 EricPixmapCache.getIcon("vcsDiff"),
771 self.tr("Show differences"), 795 self.tr("Show differences"),
772 self._VCSDiff, 796 self._VCSDiff,
773 ) 797 )
774 self.vcsDirMultiMenuActions.append(act) 798 self.vcsDirMultiMenuActions.append(act)
775 act = menu.addAction( 799 act = menu.addAction(
776 UI.PixmapCache.getIcon("vcsDiff"), 800 EricPixmapCache.getIcon("vcsDiff"),
777 self.tr("Show differences (extended)"), 801 self.tr("Show differences (extended)"),
778 self.__SVNExtendedDiff, 802 self.__SVNExtendedDiff,
779 ) 803 )
780 self.vcsDirMultiMenuActions.append(act) 804 self.vcsDirMultiMenuActions.append(act)
781 act = menu.addAction( 805 act = menu.addAction(
782 UI.PixmapCache.getIcon("vcsDiff"), 806 EricPixmapCache.getIcon("vcsDiff"),
783 self.tr("Show differences (URLs)"), 807 self.tr("Show differences (URLs)"),
784 self.__SVNUrlDiff, 808 self.__SVNUrlDiff,
785 ) 809 )
786 self.vcsDirMultiMenuActions.append(act) 810 self.vcsDirMultiMenuActions.append(act)
787 menu.addSeparator() 811 menu.addSeparator()
788 act = menu.addAction( 812 act = menu.addAction(
789 UI.PixmapCache.getIcon("vcsRevert"), 813 EricPixmapCache.getIcon("vcsRevert"),
790 self.tr("Revert changes"), 814 self.tr("Revert changes"),
791 self._VCSRevert, 815 self._VCSRevert,
792 ) 816 )
793 self.vcsDirMultiMenuActions.append(act) 817 self.vcsDirMultiMenuActions.append(act)
794 act = menu.addAction( 818 act = menu.addAction(
795 UI.PixmapCache.getIcon("vcsMerge"), self.tr("Merge changes"), self._VCSMerge 819 EricPixmapCache.getIcon("vcsMerge"),
820 self.tr("Merge changes"),
821 self._VCSMerge,
796 ) 822 )
797 self.vcsDirMultiMenuActions.append(act) 823 self.vcsDirMultiMenuActions.append(act)
798 act = menu.addAction(self.tr("Conflicts resolved"), self.__SVNResolve) 824 act = menu.addAction(self.tr("Conflicts resolved"), self.__SVNResolve)
799 self.vcsDirMultiMenuActions.append(act) 825 self.vcsDirMultiMenuActions.append(act)
800 menu.addSeparator() 826 menu.addSeparator()

eric ide

mercurial