Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

stable sync: prompt to create new branches when pushing

Changeset 7ea8d30f8c75

Parent 7bf384f40d53

by David Golub

Changes to one file · Browse files at 7ea8d30f8c75 Showing diff from parent 7bf384f40d53 Diff from another changeset...

 
296
297
298
 
299
300
301
 
656
657
658
 
659
660
661
 
712
713
714
 
 
 
 
715
716
717
 
908
909
910
 
911
912
913
 
927
928
929
 
 
 
 
 
 
 
 
 
 
 
 
930
931
932
 
934
935
936
937
 
 
938
939
940
 
296
297
298
299
300
301
302
 
657
658
659
660
661
662
663
 
714
715
716
717
718
719
720
721
722
723
 
914
915
916
917
918
919
920
 
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
 
953
954
955
 
956
957
958
959
960
@@ -296,6 +296,7 @@
  cmd.commandFinished.connect(self.commandFinished)   cmd.makeLogVisible.connect(self.makeLogVisible)   cmd.output.connect(self.output) + cmd.output.connect(self.outputHook)   cmd.progress.connect(self.progress)   if not self.embedded:   self.showMessage.connect(cmd.stbar.showMessage) @@ -656,6 +657,7 @@
  def run(self, cmdline, details):   if self.cmd.core.running():   return + self.lastcmdline = list(cmdline)   for name in list(details) + ['remotecmd']:   val = self.opts.get(name)   if not val: @@ -712,6 +714,10 @@
  self.repo.incrementBusyCount()   self.cmd.run(cmdline, display=display, useproc='p4://' in cururl)   + def outputHook(self, msg, label): + if '\'hg push --new-branch\'' in msg: + self.needNewBranch = True +   ##   ## Workbench toolbar buttons   ## @@ -908,6 +914,7 @@
  self.run(['--repository', self.repo.root, 'p4pending', '--verbose'], ())     def pushclicked(self, confirm, rev=None, branch=None): + validopts = ('force', 'new-branch', 'branch', 'rev', 'bookmark')   self.syncStarted.emit()   url = self.currentUrl(True)   urlu = hglib.tounicode(url) @@ -927,6 +934,18 @@
  self.showMessage.emit(_('Push to %s completed') % urlu)   else:   self.showMessage.emit(_('Push to %s aborted, ret %d') % (urlu, ret)) + if self.needNewBranch: + r = qtlib.QuestionMsgBox(_('Confirm New Branch'), + _('One or more of the changesets that you ' + 'are attempting to push involve the ' + 'creation of a new branch. Do you want ' + 'to create a new branch in the remote ' + 'repository?')) + if r: + cmdline = self.lastcmdline + cmdline.extend(['--new-branch']) + self.run(cmdline, validopts) + return   self.pushCompleted.emit()   self.finishfunc = finished   cmdline = ['--repository', self.repo.root, 'push'] @@ -934,7 +953,8 @@
  cmdline.extend(['--rev', str(rev)])   if branch:   cmdline.extend(['--branch', branch]) - self.run(cmdline, ('force', 'new-branch', 'branch', 'rev', 'bookmark')) + self.needNewBranch = False + self.run(cmdline, validopts)     def postpullclicked(self):   dlg = PostPullDialog(self.repo, self)