eric6/Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 7791
f07ded9bc64d
parent 7790
32b8db5a1fb4
child 7836
2f0d208b8137
equal deleted inserted replaced
7790:32b8db5a1fb4 7791:f07ded9bc64d
304 """ 304 """
305 msg = vcsDataDict["message"] 305 msg = vcsDataDict["message"]
306 if not msg: 306 if not msg:
307 msg = '***' 307 msg = '***'
308 308
309 # TODO: hg init has to be run with the hg command line client
310 args = self.initCommand("init") 309 args = self.initCommand("init")
311 args.append(projectDir) 310 args.append(projectDir)
312 # init is not possible with the command server
313 dia = HgDialog(self.tr('Creating Mercurial repository'), self) 311 dia = HgDialog(self.tr('Creating Mercurial repository'), self)
314 res = dia.startProcess(args) 312 res = dia.startProcess(args)
315 if res: 313 if res:
316 dia.exec() 314 dia.exec()
317 status = dia.normalExit() 315 status = dia.normalExit()
318 316
319 if status: 317 if status:
318 self.stopClient()
319 self.__repoDir = projectDir
320
320 ignoreName = os.path.join(projectDir, Hg.IgnoreFileName) 321 ignoreName = os.path.join(projectDir, Hg.IgnoreFileName)
321 if not os.path.exists(ignoreName): 322 if not os.path.exists(ignoreName):
322 status = self.hgCreateIgnoreFile(projectDir) 323 status = self.hgCreateIgnoreFile(projectDir)
323 324
324 if status and addAll: 325 if status and addAll:
3377 Private method to create a Mercurial command server client. 3378 Private method to create a Mercurial command server client.
3378 3379
3379 @param repodir path of the local repository 3380 @param repodir path of the local repository
3380 @type str 3381 @type str
3381 """ 3382 """
3382 if self.__client is not None: 3383 self.stopClient()
3383 self.__client.stopServer()
3384 self.__client = None
3385 3384
3386 self.__client = HgClient(repodir, "utf-8", self) 3385 self.__client = HgClient(repodir, "utf-8", self)
3387 ok, err = self.__client.startServer() 3386 ok, err = self.__client.startServer()
3388 if not ok: 3387 if not ok:
3389 E5MessageBox.warning( 3388 E5MessageBox.warning(
3401 """ 3400 """
3402 if self.__client is None: 3401 if self.__client is None:
3403 self.__createClient(self.__repoDir) 3402 self.__createClient(self.__repoDir)
3404 3403
3405 return self.__client 3404 return self.__client
3405
3406 def stopClient(self):
3407 """
3408 Public method to stop the command server client.
3409 """
3410 if self.__client is not None:
3411 self.__client.stopServer()
3412 self.__client = None
3406 3413
3407 ########################################################################### 3414 ###########################################################################
3408 ## Status Monitor Thread methods 3415 ## Status Monitor Thread methods
3409 ########################################################################### 3416 ###########################################################################
3410 3417

eric ide

mercurial