129 self.tr('Adding files to the Mercurial repository'), |
129 self.tr('Adding files to the Mercurial repository'), |
130 self.vcs) |
130 self.vcs) |
131 res = dia.startProcess(args, repodir) |
131 res = dia.startProcess(args, repodir) |
132 if res: |
132 if res: |
133 dia.exec_() |
133 dia.exec_() |
|
134 |
|
135 def hgLfPull(self, projectDir, revisions=None): |
|
136 """ |
|
137 Public method to pull missing large files into the local repository. |
|
138 |
|
139 @param projectDir directory name of the project (string) |
|
140 @param revisions list of revisions to pull (list of string) |
|
141 """ |
|
142 # find the root of the repo |
|
143 repodir = projectDir |
|
144 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)): |
|
145 repodir = os.path.dirname(repodir) |
|
146 if os.path.splitdrive(repodir)[1] == os.sep: |
|
147 return |
|
148 |
|
149 revs = [] |
|
150 if revisions: |
|
151 revs = revisions |
|
152 else: |
|
153 from .LfRevisionsInputDialog import LfRevisionsInputDialog |
|
154 dlg = LfRevisionsInputDialog() |
|
155 if dlg.exec_() == QDialog.Accepted: |
|
156 revs = dlg.getRevisions() |
|
157 |
|
158 if revs: |
|
159 args = self.vcs.initCommand("lfpull") |
|
160 args.append("-v") |
|
161 for rev in revs: |
|
162 args.append("--rev") |
|
163 args.append(rev) |
|
164 |
|
165 dia = HgDialog(self.tr("Pulling large files"), self.vcs) |
|
166 res = dia.startProcess(args, repodir) |
|
167 if res: |
|
168 dia.exec_() |
|
169 |
|
170 def hgLfVerify(self, projectDir, mode): |
|
171 """ |
|
172 Public method to verify large files integrity. |
|
173 |
|
174 @param projectDir directory name of the project (string) |
|
175 @param mode verify mode (string; one of 'large', 'lfa' or 'lfc') |
|
176 """ |
|
177 # find the root of the repo |
|
178 repodir = projectDir |
|
179 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)): |
|
180 repodir = os.path.dirname(repodir) |
|
181 if os.path.splitdrive(repodir)[1] == os.sep: |
|
182 return |
|
183 |
|
184 args = self.vcs.initCommand("verify") |
|
185 if mode == "large": |
|
186 args.append("--large") |
|
187 elif mode == "lfa": |
|
188 args.append("--lfa") |
|
189 elif mode == "lfc": |
|
190 args.append("--lfc") |
|
191 else: |
|
192 return |
|
193 |
|
194 dia = HgDialog( |
|
195 self.tr('Verifying the integrity of large files'), |
|
196 self.vcs) |
|
197 res = dia.startProcess(args, repodir) |
|
198 if res: |
|
199 dia.exec_() |