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

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

eric ide

mercurial