--- a/Plugins/VcsPlugins/vcsMercurial/hg.py Sun Apr 13 15:45:57 2014 +0200 +++ b/Plugins/VcsPlugins/vcsMercurial/hg.py Tue Apr 15 22:41:08 2014 +0200 @@ -2110,6 +2110,36 @@ dia.exec_() self.checkVCSStatus() + def hgCancelMerge(self, name): + """ + Public method to cancel an uncommitted merge. + + @param name file/directory name (string) + @return flag indicating, that the cancellation contained an add + or delete (boolean) + """ + dname, fname = self.splitPath(name) + + # find the root of the repo + repodir = dname + while not os.path.isdir(os.path.join(repodir, self.adminDir)): + repodir = os.path.dirname(repodir) + if os.path.splitdrive(repodir)[1] == os.sep: + return + + args = self.initCommand("update") + args.append("--clean") + + dia = HgDialog( + self.tr('Cancelling uncommitted merge'), + self) + res = dia.startProcess(args, repodir, False) + if res: + dia.exec_() + res = dia.hasAddOrDelete() + self.checkVCSStatus() + return res + def hgBranch(self, name): """ Public method used to create a branch in the Mercurial repository.