Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py

changeset 1068
090e5be55051
parent 1066
a3dd41fd9ea8
child 1087
fb8cd56819a9
equal deleted inserted replaced
1067:1a6dd77e6413 1068:090e5be55051
340 Queues.PUSH, Queues.GOTO) 340 Queues.PUSH, Queues.GOTO)
341 @keyparam all flag indicating to push/pop all (boolean) 341 @keyparam all flag indicating to push/pop all (boolean)
342 @keyparam named flag indicating to push/pop until a named patch 342 @keyparam named flag indicating to push/pop until a named patch
343 is at the top of the stack (boolean) 343 is at the top of the stack (boolean)
344 @keyparam force flag indicating a forceful pop (boolean) 344 @keyparam force flag indicating a forceful pop (boolean)
345 """ 345 @return flag indicating that the project should be reread (boolean)
346 # find the root of the repo 346 """
347 repodir = self.vcs.splitPath(name)[0] 347 # find the root of the repo
348 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)): 348 repodir = self.vcs.splitPath(name)[0]
349 repodir = os.path.dirname(repodir) 349 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
350 if repodir == os.sep: 350 repodir = os.path.dirname(repodir)
351 return 351 if repodir == os.sep:
352 return False
352 353
353 args = [] 354 args = []
354 if operation == Queues.POP: 355 if operation == Queues.POP:
355 args.append("qpop") 356 args.append("qpop")
356 title = self.trUtf8("Pop Patches") 357 title = self.trUtf8("Pop Patches")
363 args.append("qgoto") 364 args.append("qgoto")
364 title = self.trUtf8("Go to Patch") 365 title = self.trUtf8("Go to Patch")
365 listType = Queues.SERIES_LIST 366 listType = Queues.SERIES_LIST
366 else: 367 else:
367 raise ValueError("illegal value for operation") 368 raise ValueError("illegal value for operation")
369 args.append("-v")
368 if force: 370 if force:
369 args.append("--force") 371 args.append("--force")
370 if all and operation in (Queues.POP, Queues.PUSH): 372 if all and operation in (Queues.POP, Queues.PUSH):
371 args.append("--all") 373 args.append("--all")
372 elif named or operation == Queues.GOTO: 374 elif named or operation == Queues.GOTO:
379 patchnames, 381 patchnames,
380 0, False) 382 0, False)
381 if ok and patch: 383 if ok and patch:
382 args.append(patch) 384 args.append(patch)
383 else: 385 else:
384 return 386 return False
385 else: 387 else:
386 E5MessageBox.information(None, 388 E5MessageBox.information(None,
387 self.trUtf8("Select Patch"), 389 self.trUtf8("Select Patch"),
388 self.trUtf8("""No patches to select from.""")) 390 self.trUtf8("""No patches to select from."""))
389 return 391 return False
390 392
391 dia = HgDialog(title) 393 dia = HgDialog(title)
392 res = dia.startProcess(args, repodir) 394 res = dia.startProcess(args, repodir)
393 if res: 395 if res:
394 dia.exec_() 396 dia.exec_()
397 res = dia.hasAddOrDelete()
395 self.vcs.checkVCSStatus() 398 self.vcs.checkVCSStatus()
399 return res
396 400
397 def hgQueueListPatches(self, name): 401 def hgQueueListPatches(self, name):
398 """ 402 """
399 Public method to show a list of all patches. 403 Public method to show a list of all patches.
400 404

eric ide

mercurial