eric6/Plugins/VcsPlugins/vcsMercurial/LargefilesExtension/ProjectHelper.py

Wed, 30 Dec 2020 11:00:44 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:44 +0100
branch
maintenance
changeset 7924
8a96736d465e
parent 7780
41420f82c0ac
child 7970
c4ee8a81584c
permissions
-rw-r--r--

Updated copyright for 2021.

3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2014 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the shelve extension project helper.
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
10 from PyQt5.QtWidgets import QMenu
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 from E5Gui.E5Action import E5Action
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from ..HgExtensionProjectHelper import HgExtensionProjectHelper
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
16 import UI.PixmapCache
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
17
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 class LargefilesProjectHelper(HgExtensionProjectHelper):
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 Class implementing the queues extension project helper.
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 def __init__(self):
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 Constructor
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
3484
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3345
diff changeset
27 super(LargefilesProjectHelper, self).__init__()
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 def initActions(self):
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 Public method to generate the action objects.
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 self.hgConvertToLargefilesAct = E5Action(
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 self.tr('Convert repository to largefiles'),
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 self.tr('Convert repository to largefiles...'),
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 0, 0, self, 'mercurial_convert_to_largefiles')
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 self.hgConvertToLargefilesAct.setStatusTip(self.tr(
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 'Convert the repository of the project to a largefiles repository.'
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 ))
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 self.hgConvertToLargefilesAct.setWhatsThis(self.tr(
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 """<b>Convert repository to largefiles</b>"""
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 """<p>This converts the repository of the project to a"""
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 """ largefiles repository. A new project is created. The"""
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 """ current one is kept as a backup.</p>"""
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
46 self.hgConvertToLargefilesAct.triggered.connect(
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 lambda: self.__hgLfconvert("largefiles"))
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 self.actions.append(self.hgConvertToLargefilesAct)
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 self.hgConvertToNormalAct = E5Action(
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.tr('Convert repository to normal'),
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.tr('Convert repository to normal...'),
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 0, 0, self, 'mercurial_convert_to_normal')
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 self.hgConvertToNormalAct.setStatusTip(self.tr(
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 'Convert the repository of the project to a normal repository.'
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 ))
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 self.hgConvertToNormalAct.setWhatsThis(self.tr(
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 """<b>Convert repository to normal</b>"""
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 """<p>This converts the repository of the project to a"""
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 """ normal repository. A new project is created. The current"""
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 """ one is kept as a backup.</p>"""
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
63 self.hgConvertToNormalAct.triggered.connect(
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 lambda: self.__hgLfconvert("normal"))
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 self.actions.append(self.hgConvertToNormalAct)
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
66
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
67 self.hgLfPullAct = E5Action(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
68 self.tr('Pull Large Files'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
69 UI.PixmapCache.getIcon("vcsUpdate"),
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
70 self.tr('Pull Large Files'),
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
71 0, 0, self, 'mercurial_pull_largefiles')
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
72 self.hgLfPullAct.setStatusTip(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
73 'Pull large files from a remote repository'
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
74 ))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
75 self.hgLfPullAct.setWhatsThis(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
76 """<b>Pull Large Files</b>"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
77 """<p>This pulls missing large files from a remote repository"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
78 """ into the local repository.</p>"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
79 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
80 self.hgLfPullAct.triggered.connect(self.__hgLfPull)
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
81 self.actions.append(self.hgLfPullAct)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
82
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
83 self.hgLfSummaryAct = E5Action(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
84 self.tr('Show Summary'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
85 UI.PixmapCache.getIcon("vcsSummary"),
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
86 self.tr('Show summary...'),
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
87 0, 0, self, 'mercurial_summary_largefiles')
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
88 self.hgLfSummaryAct.setStatusTip(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
89 'Show summary information of the working directory status'
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
90 ))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
91 self.hgLfSummaryAct.setWhatsThis(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
92 """<b>Show summary</b>"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
93 """<p>This shows some summary information of the working"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
94 """ directory status.</p>"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
95 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
96 self.hgLfSummaryAct.triggered.connect(self.__hgLfSummary)
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
97 self.actions.append(self.hgLfSummaryAct)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
98
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
99 self.hgVerifyLargeAct = E5Action(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
100 self.tr('Verify large files of current revision'),
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
101 self.tr('Verify large files of current revision...'),
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
102 0, 0, self, 'mercurial_verify_large')
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
103 self.hgVerifyLargeAct.setStatusTip(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
104 'Verify that all large files in the current revision exist'
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
105 ))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
106 self.hgVerifyLargeAct.setWhatsThis(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
107 """<b>Verify large files of current revision</b>"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
108 """<p>This verifies that all large files in the current"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
109 """ revision exist.</p>"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
110 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
111 self.hgVerifyLargeAct.triggered.connect(
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
112 lambda: self.__hgLfVerify("large"))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
113 self.actions.append(self.hgVerifyLargeAct)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
114
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
115 self.hgVerifyLfaAct = E5Action(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
116 self.tr('Verify large files of all revision'),
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
117 self.tr('Verify large files of all revision...'),
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
118 0, 0, self, 'mercurial_verify_lfa')
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
119 self.hgVerifyLfaAct.setStatusTip(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
120 'Verify that all large files in all revisions exist'
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
121 ))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
122 self.hgVerifyLfaAct.setWhatsThis(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
123 """<b>Verify large files of all revision</b>"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
124 """<p>This verifies that all large files in all"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
125 """ revisions exist.</p>"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
126 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
127 self.hgVerifyLfaAct.triggered.connect(
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
128 lambda: self.__hgLfVerify("lfa"))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
129 self.actions.append(self.hgVerifyLfaAct)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
130
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
131 self.hgVerifyLfcAct = E5Action(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
132 self.tr('Verify large files contents'),
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
133 self.tr('Verify large files contents...'),
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
134 0, 0, self, 'mercurial_verify_lfc')
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
135 self.hgVerifyLfcAct.setStatusTip(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
136 'Verify the contents of all large files'
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
137 ))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
138 self.hgVerifyLfcAct.setWhatsThis(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
139 """<b>Verify large files contents</b>"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
140 """<p>This verifies the contents of all large files.</p>"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
141 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
142 self.hgVerifyLfcAct.triggered.connect(
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
143 lambda: self.__hgLfVerify("lfc"))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
144 self.actions.append(self.hgVerifyLfcAct)
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 def initMenu(self, mainMenu):
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 Public method to generate the extension menu.
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 @param mainMenu reference to the main menu (QMenu)
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 @return populated menu (QMenu)
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 menu = QMenu(self.menuTitle(), mainMenu)
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 menu.setTearOffEnabled(True)
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
156 self.__adminMenu = QMenu(self.tr("Administration"), menu)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
157 self.__adminMenu.setTearOffEnabled(True)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
158 self.__adminMenu.addAction(self.hgVerifyLargeAct)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
159 self.__adminMenu.addAction(self.hgVerifyLfaAct)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
160 self.__adminMenu.addAction(self.hgVerifyLfcAct)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
161
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 menu.addAction(self.hgConvertToLargefilesAct)
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 menu.addAction(self.hgConvertToNormalAct)
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
164 menu.addSeparator()
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
165 menu.addAction(self.hgLfPullAct)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
166 menu.addSeparator()
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
167 menu.addAction(self.hgLfSummaryAct)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
168 menu.addSeparator()
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
169 menu.addMenu(self.__adminMenu)
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 return menu
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 def menuTitle(self):
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 Public method to get the menu title.
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 @return title of the menu (string)
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 return self.tr("Large Files")
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
181 def shutdown(self):
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
182 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
183 Public method to perform shutdown actions.
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
184
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
185 Note: Derived class may implement this method if needed.
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
186 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
187 if self.__adminMenu.isTearOffMenuVisible():
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
188 self.__adminMenu.hideTearOffMenu()
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
189
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 def __hgLfconvert(self, direction):
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 """
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 Private slot to convert the repository format of the current project.
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
194 @param direction direction of the conversion (string; one of
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 'largefiles' or 'normal')
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
196 @exception ValueError raised to indicate a bad value for the
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
197 'direction' parameter.
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 """
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
199 if direction not in ["largefiles", "normal"]:
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
200 raise ValueError("Bad value for 'direction' parameter.")
3310
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 self.vcs.getExtensionObject("largefiles").hgLfconvert(
a2032ed66aec Started implementing the Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 direction, self.project.getProjectFile())
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
204
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
205 def __hgLfPull(self):
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
206 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
207 Private slot to pull missing large files into the local repository.
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
208 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
209 self.vcs.getExtensionObject("largefiles").hgLfPull(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
210 self.project.getProjectPath())
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
211
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
212 def __hgLfSummary(self):
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
213 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
214 Private slot to show a working directory summary.
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
215 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
216 self.vcs.hgSummary(largefiles=True)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
217
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
218 def __hgLfVerify(self, mode):
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
219 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
220 Private slot to verify large files integrity.
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
221
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
222 @param mode verify mode (string; one of 'large', 'lfa' or 'lfc')
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
223 @exception ValueError raised to indicate a bad value for the
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
224 'mode' parameter.
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
225 """
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
226 if mode not in ['large', 'lfa', 'lfc']:
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
227 raise ValueError("Bad value for 'mode' parameter.")
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
228
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
229 self.vcs.getExtensionObject("largefiles").hgLfVerify(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3310
diff changeset
230 self.project.getProjectPath(), mode)

eric ide

mercurial