Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

commit: force user to verify a new branch, or override existing

Changeset 9ebb3ce0158e

Parent 95bec2d6ed59

by Steve Borho

Changes to one file · Browse files at 9ebb3ce0158e Showing diff from parent 95bec2d6ed59 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​commit.py Stacked
 
443
444
445
446
 
447
448
 
 
 
 
 
 
 
 
 
 
 
 
 
 
449
450
451
 
443
444
445
 
446
447
 
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
@@ -443,9 +443,22 @@
  self.ui = self.repo.ui   return   - newbranch = self.branchentry.get_text() + newbranch = fromutf(self.branchentry.get_text())   if newbranch != self.repo.dirstate.branch(): - self.repo.dirstate.setbranch(newbranch) + if newbranch in self.repo.branchtags(): + if newbranch not in [p.branch() for p in self.repo.parents()]: + response = Confirm('Override Branch', [], self, + 'A branch named "%s" already exists,\n' + 'override?' % newbranch).run() + else: + response = gtk.RESPONSE_YES + else: + response = Confirm('New Branch', [], self, + 'Create new named branch "%s"?' % newbranch).run() + if response == gtk.RESPONSE_YES: + self.repo.dirstate.setbranch(newbranch) + elif response != gtk.RESPONSE_NO: + return     # call the threaded CmdDialog to do the commit, so the the large commit   # won't get locked up by potential large commit. CmdDialog will also