Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.1, 1.1.1, and 1.1.2

Merge with stable

Changeset ca5e452dfae6

Parents 2548df5279b6

Parents ca6abee62f31

by Steve Borho

Changes to 2 files · Browse files at ca5e452dfae6 Showing diff from parent 2548df5279b6 ca6abee62f31 Diff from another changeset...

 
2005
2006
2007
2008
2009
 
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
 
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
 
 
 
2592
2593
2594
2595
2596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2597
 
2598
2599
2600
 
 
2601
2602
2603
 
2005
2006
2007
 
 
2008
2009
 
 
 
 
2010
2011
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2012
2013
2014
 
2553
2554
2555
 
 
 
 
 
 
 
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
@@ -2005,39 +2005,10 @@
  self.show_dialog(dlg)     def push_clicked(self, toolbutton): - original_path = hglib.fromutf(self.pathentry.get_text()).strip() - remote_path = hglib.validate_synch_path(original_path, self.repo) + remote_path = self.validate_path()   if not remote_path: - gdialog.Prompt(_('No remote path specified'), - _('Please enter or select a remote path'), - self).run() - self.pathentry.grab_focus()   return   - confirm_push = False - if not hg.islocal(remote_path): - if self.forcepush: - title = _('Confirm Forced Push to Remote Repository') - text = _('Forced push to remote repository\n%s\n' - '(creating new heads in remote if needed)?') % original_path - buttontext = _('Forced &Push') - else: - title = _('Confirm Push to remote Repository') - text = _('Push to remote repository\n%s\n?') % original_path - buttontext = _('&Push') - confirm_push = True - elif self.forcepush: - title = _('Confirm Forced Push') - text = _('Forced push to repository\n%s\n' - '(creating new heads if needed)?') % original_path - buttontext = _('Forced &Push') - confirm_push = True - if confirm_push: - dlg = gdialog.CustomPrompt(title, text, - None, (buttontext, _('&Cancel')), default=1, esc=1) - if dlg.run() != 0: - return -   cmdline = ['hg', 'push'] + self.get_proxy_args()   if self.forcepush:   cmdline += ['--force'] @@ -2582,22 +2553,55 @@
  statopts)   dialog.display()   - def push_to(self, menuitem): - remote_path = hglib.fromutf(self.pathentry.get_text()).strip() - for alias, path in self.repo.ui.configitems('paths'): - if remote_path == alias: - remote_path = path - elif remote_path == url.hidepassword(path): - remote_path = path + def validate_path(self): + original_path = hglib.fromutf(self.pathentry.get_text()).strip() + remote_path = hglib.validate_synch_path(original_path, self.repo)   if not remote_path:   gdialog.Prompt(_('No remote path specified'),   _('Please enter or select a remote path'),   self).run()   self.pathentry.grab_focus() + return None + else: + confirm_push = False + if not hg.islocal(remote_path): + if self.forcepush: + title = _('Confirm Forced Push to Remote Repository') + text = _('Forced push to remote repository\n%s\n' + '(creating new heads in remote if needed)?') % original_path + buttontext = _('Forced &Push') + else: + title = _('Confirm Push to remote Repository') + text = _('Push to remote repository\n%s\n?') % original_path + buttontext = _('&Push') + confirm_push = True + elif self.forcepush: + title = _('Confirm Forced Push') + text = _('Forced push to repository\n%s\n' + '(creating new heads if needed)?') % original_path + buttontext = _('Forced &Push') + confirm_push = True + + if confirm_push: + dlg = gdialog.CustomPrompt(title, text, + None, (buttontext, _('&Cancel')), default=1, esc=1) + if dlg.run() != 0: + return None + else: + return remote_path + else: + return remote_path + + def push_to(self, menuitem): + remote_path = self.validate_path() + if not remote_path:   return +   node = self.repo[self.currevid].node()   rev = str(self.currevid)   cmdline = ['hg', 'push', '--rev', rev, remote_path] + if self.forcepush: + cmdline += ['--force']     def callback(return_code, *args):   if return_code == 0:
 
21
22
23
 
 
 
 
24
25
26
27
28
 
29
30
31
 
21
22
23
24
25
26
27
28
29
 
30
 
31
32
33
34
@@ -21,11 +21,14 @@
   if os.name == 'nt':   def browse_url(url): + try: + import win32api + except ImportError: + return   def start_browser():   try: - import win32api   win32api.ShellExecute(0, 'open', url, None, None, 0) - except (ImportError, Exception): + except Exception:   pass   threading.Thread(target=start_browser).start()