src/eric7/Plugins/VcsPlugins/vcsMercurial/StripExtension/strip.py

branch
eric7
changeset 11006
a671918232f3
parent 10439
21c28b0f9e41
equal deleted inserted replaced
11005:b918c6c2736b 11006:a671918232f3
16 class Strip(HgExtension): 16 class Strip(HgExtension):
17 """ 17 """
18 Class implementing the strip extension interface. 18 Class implementing the strip extension interface.
19 """ 19 """
20 20
21 def __init__(self, vcs): 21 def __init__(self, vcs, ui=None):
22 """ 22 """
23 Constructor 23 Constructor
24 24
25 @param vcs reference to the Mercurial vcs object 25 @param vcs reference to the Mercurial vcs object
26 @type Hg 26 @type Hg
27 @param ui reference to a UI widget (defaults to None)
28 @type QWidget
27 """ 29 """
28 super().__init__(vcs) 30 super().__init__(vcs, ui=ui)
29 31
30 def hgStrip(self, rev=""): 32 def hgStrip(self, rev=""):
31 """ 33 """
32 Public method to strip revisions from a repository. 34 Public method to strip revisions from a repository.
33 35
42 dlg = HgStripDialog( 44 dlg = HgStripDialog(
43 self.vcs.hgGetTagsList(), 45 self.vcs.hgGetTagsList(),
44 self.vcs.hgGetBranchesList(), 46 self.vcs.hgGetBranchesList(),
45 self.vcs.hgGetBookmarksList(), 47 self.vcs.hgGetBookmarksList(),
46 rev, 48 rev,
49 parent=self.ui,
47 ) 50 )
48 if dlg.exec() == QDialog.DialogCode.Accepted: 51 if dlg.exec() == QDialog.DialogCode.Accepted:
49 rev, bookmark, force, noBackup, keep = dlg.getData() 52 rev, bookmark, force, noBackup, keep = dlg.getData()
50 53
51 args = self.vcs.initCommand("strip") 54 args = self.vcs.initCommand("strip")
59 if keep: 62 if keep:
60 args.append("--keep") 63 args.append("--keep")
61 args.append("-v") 64 args.append("-v")
62 args.append(rev) 65 args.append(rev)
63 66
64 dia = HgDialog(self.tr("Stripping changesets from repository"), self.vcs) 67 dia = HgDialog(
68 self.tr("Stripping changesets from repository"),
69 hg=self.vcs,
70 parent=self.ui,
71 )
65 res = dia.startProcess(args) 72 res = dia.startProcess(args)
66 if res: 73 if res:
67 dia.exec() 74 dia.exec()
68 res = dia.hasAddOrDelete() 75 res = dia.hasAddOrDelete()
69 self.vcs.checkVCSStatus() 76 self.vcs.checkVCSStatus()

eric ide

mercurial