Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 3479
5ff8124c73aa
parent 3475
852dc7d65ff0
child 3515
1b8381afe38f
equal deleted inserted replaced
3478:beec1d9c1851 3479:5ff8124c73aa
2103 res = dia.startProcess(args, repodir) 2103 res = dia.startProcess(args, repodir)
2104 if res: 2104 if res:
2105 dia.exec_() 2105 dia.exec_()
2106 self.checkVCSStatus() 2106 self.checkVCSStatus()
2107 2107
2108 def hgCancelMerge(self, name):
2109 """
2110 Public method to cancel an uncommitted merge.
2111
2112 @param name file/directory name (string)
2113 @return flag indicating, that the cancellation contained an add
2114 or delete (boolean)
2115 """
2116 dname, fname = self.splitPath(name)
2117
2118 # find the root of the repo
2119 repodir = dname
2120 while not os.path.isdir(os.path.join(repodir, self.adminDir)):
2121 repodir = os.path.dirname(repodir)
2122 if os.path.splitdrive(repodir)[1] == os.sep:
2123 return
2124
2125 args = self.initCommand("update")
2126 args.append("--clean")
2127
2128 dia = HgDialog(
2129 self.tr('Cancelling uncommitted merge'),
2130 self)
2131 res = dia.startProcess(args, repodir, False)
2132 if res:
2133 dia.exec_()
2134 res = dia.hasAddOrDelete()
2135 self.checkVCSStatus()
2136 return res
2137
2108 def hgBranch(self, name): 2138 def hgBranch(self, name):
2109 """ 2139 """
2110 Public method used to create a branch in the Mercurial repository. 2140 Public method used to create a branch in the Mercurial repository.
2111 2141
2112 @param name file/directory name to be branched (string) 2142 @param name file/directory name to be branched (string)
2766 dia = HgDialog(self.tr('Rollback last transaction'), self) 2796 dia = HgDialog(self.tr('Rollback last transaction'), self)
2767 res = dia.startProcess(["rollback"], repodir) 2797 res = dia.startProcess(["rollback"], repodir)
2768 if res: 2798 if res:
2769 dia.exec_() 2799 dia.exec_()
2770 2800
2771 # TODO: add support for hg update --clean to revert a failed/aborted merge
2772
2773 def hgServe(self, name): 2801 def hgServe(self, name):
2774 """ 2802 """
2775 Public method used to serve the project. 2803 Public method used to serve the project.
2776 2804
2777 @param name directory name (string) 2805 @param name directory name (string)

eric ide

mercurial