Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

history: add Synchronize menu

'Use proxy server' and 'Force push' do not do anything yet

Changeset 69e63be88b74

Parent fa025bd9f03f

by Steve Borho

Changes to one file · Browse files at 69e63be88b74 Showing diff from parent fa025bd9f03f Diff from another changeset...

 
95
96
97
 
 
 
 
98
99
100
 
150
151
152
153
 
 
 
 
 
 
 
 
 
 
 
 
154
155
156
 
758
759
760
 
761
762
763
 
774
775
776
777
778
 
 
 
 
779
780
 
781
782
783
 
800
801
802
 
 
803
804
805
806
807
808
809
810
 
918
919
920
921
 
 
 
922
923
924
 
948
949
950
951
 
952
953
954
 
971
972
973
974
 
975
976
977
 
983
984
985
986
 
987
988
989
 
1022
1023
1024
1025
 
 
1026
1027
1028
 
1038
1039
1040
1041
 
1042
1043
1044
 
1051
1052
1053
1054
 
1055
1056
1057
 
1058
1059
1060
 
1077
1078
1079
1080
1081
 
 
1082
1083
1084
 
1087
1088
1089
1090
1091
 
 
1092
1093
1094
1095
 
 
1096
1097
1098
1099
1100
 
1101
1102
1103
1104
1105
1106
1107
1108
 
 
1109
1110
1111
 
1122
1123
1124
1125
 
1126
1127
1128
 
95
96
97
98
99
100
101
102
103
104
 
154
155
156
 
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
 
773
774
775
776
777
778
779
 
790
791
792
 
 
793
794
795
796
797
 
798
799
800
801
 
818
819
820
821
822
823
 
 
 
 
824
825
826
 
934
935
936
 
937
938
939
940
941
942
 
966
967
968
 
969
970
971
972
 
989
990
991
 
992
993
994
995
 
1001
1002
1003
 
1004
1005
1006
1007
 
1040
1041
1042
 
1043
1044
1045
1046
1047
 
1057
1058
1059
 
1060
1061
1062
1063
 
1070
1071
1072
 
1073
1074
1075
 
1076
1077
1078
1079
 
1096
1097
1098
 
 
1099
1100
1101
1102
1103
 
1106
1107
1108
 
 
1109
1110
1111
1112
 
 
1113
1114
1115
1116
1117
1118
 
1119
1120
1121
1122
1123
1124
 
 
 
1125
1126
1127
1128
1129
 
1140
1141
1142
 
1143
1144
1145
1146
@@ -95,6 +95,10 @@
  return tbar     def get_menu_list(self): + def toggle_proxy(menuitem): + pass + def toggle_force(menuitem): + pass   def refresh(menuitem, resetmarks):   if resetmarks:   self.outgoing = [] @@ -150,7 +154,18 @@
  (_('Working Parent'), False, navigate, ['.'], None),   ('----', None, None, None, None),   (_('Revision...'), False, navigate, [None], None), - ] + bmenus) + ] + bmenus), + + (_('_Synchronize'), [ + (_('Incoming'), False, self.incoming_clicked, [], None), + (_('Pull'), False, self.pull_clicked, [], None), + (_('Outgoing'), False, self.outgoing_clicked, [], None), + (_('Push'), False, self.push_clicked, [], None), + (_('Email...'), False, self.email_clicked, [], None), + ('----', None, None, None, None), + (_('Use proxy server'), True, toggle_proxy, [], False), + (_('Force push'), True, toggle_force, [], False), + ])   ]     def synch_clicked(self, toolbutton, data): @@ -758,6 +773,7 @@
  stop = syncbox.append_stock(gtk.STOCK_STOP,   _('Stop current transaction'))   stop.set_sensitive(False) + self.stop_button = stop     ## target path combobox   urllist = gtk.ListStore(str, str) @@ -774,10 +790,12 @@
  if alias == 'default':   urlcombo.set_active(len(urllist)-1)   - outgoing.connect('clicked', self.outgoing_clicked, urlcombo, stop) - push.connect('clicked', self.push_clicked, urlcombo) + incoming.connect('clicked', self.incoming_clicked) + pull.connect('clicked', self.pull_clicked) + outgoing.connect('clicked', self.outgoing_clicked) + push.connect('clicked', self.push_clicked)   conf.connect('clicked', self.conf_clicked, urlcombo) - email.connect('clicked', self.email_clicked, urlcombo) + email.connect('clicked', self.email_clicked)     syncbox.append_widget(gtk.Label(_('After Pull:')))   ppulldata = [('none', _('Nothing')), ('update', _('Update'))] @@ -800,11 +818,9 @@
  pos = [index for (index, (name, label))   in enumerate(ppulldata) if name == 'none'][0]   ppullcombo.set_active(pos) + self.ppullcombo = ppullcombo + self.ppulldata = ppulldata   - incoming.connect('clicked', self.incoming_clicked, urlcombo, - ppullcombo, ppulldata) - pull.connect('clicked', self.pull_clicked, urlcombo, ppullcombo, - ppulldata)   syncbox.append_widget(ppullcombo)     # filter bar @@ -918,7 +934,9 @@
  def get_extras(self):   return self.stbar   - def incoming_clicked(self, toolbutton, combo, ppullcombo, ppulldata): + def incoming_clicked(self, toolbutton): + ppullcombo, ppulldata = self.ppullcombo, self.ppulldata +   def apply_clicked(button, bfile):   sel = ppullcombo.get_active_text()   ppull = [name for (name, label) in ppulldata if sel == label][0] @@ -948,7 +966,7 @@
  def remove_overlay(resettip):   self.bfile = None   self.npreviews = 0 - combo.get_child().set_text('') + self.pathentry.set_text('')   self.repo = hg.repository(self.ui, path=self.repo.root)   self.graphview.set_repo(self.repo, self.stbar)   self.changeview.repo = self.repo @@ -971,7 +989,7 @@
  self.bundledir = tempfile.mkdtemp(prefix='thg-incoming-')   atexit.register(cleanup)   - path = combo.get_child().get_text() + path = self.pathentry.get_text()   bfile = path   for badchar in (':', '*', '\\', '?', '#'):   bfile = bfile.replace(badchar, '') @@ -983,7 +1001,7 @@
  dlg.run()   dlg.hide()   if dlg.return_code() == 0 and os.path.isfile(bfile): - combo.get_child().set_text(bfile) + self.pathentry.set_text(bfile)     # create apply/reject toolbar buttons   apply = gtk.ToolButton(gtk.STOCK_APPLY) @@ -1022,7 +1040,8 @@
  self.npreviews = len(self.repo) - oldtip   self.reload_log()   - def pull_clicked(self, toolbutton, combo, ppullcombo, ppulldata): + def pull_clicked(self, toolbutton): + ppullcombo, ppulldata = self.ppullcombo, self.ppulldata   sel = ppullcombo.get_active_text()   ppull = [name for (name, label) in ppulldata if sel == label][0]   if ppull == 'fetch': @@ -1038,7 +1057,7 @@
  # load the rebase extension explicitly   extensions.load(self.ui, 'rebase', None)   - cmdline = ['hg'] + cmd + [combo.get_child().get_text()] + cmdline = ['hg'] + cmd + [self.pathentry.get_text()]   dlg = hgcmd.CmdDialog(cmdline, text=' '.join(['hg'] + cmd))   dlg.show_all()   dlg.run() @@ -1051,10 +1070,10 @@
  elif len(self.repo) > self.origtip:   self.reload_log()   - def outgoing_clicked(self, toolbutton, combo, stop): + def outgoing_clicked(self, toolbutton):   q = Queue.Queue()   cmd = [q, 'outgoing', '--quiet', '--template', '{node}\n', - combo.get_child().get_text()] + self.pathentry.get_text()]     def threadfunc(q, *args):   try: @@ -1077,8 +1096,8 @@
  self.graphview.set_outgoing(outgoing)   self.outgoing = outgoing   self.reload_log() - stop.disconnect(stop_handler) - stop.set_sensitive(False) + self.stop_button.disconnect(stop_handler) + self.stop_button.set_sensitive(False)     def stop_clicked(button):   thread.terminate() @@ -1087,25 +1106,24 @@
  thread = thread2.Thread(target=threadfunc, args=cmd)   thread.start()   self.stbar.begin() - stop_handler = stop.connect('clicked', stop_clicked) - stop.set_sensitive(True) + stop_handler = self.stop_button.connect('clicked', stop_clicked) + self.stop_button.set_sensitive(True)   gobject.timeout_add(50, out_wait)   - def email_clicked(self, toolbutton, combo): - path = hglib.fromutf(combo.get_child().get_text()).strip() + def email_clicked(self, toolbutton): + path = hglib.fromutf(self.pathentry.get_text()).strip()   if not path:   gdialog.Prompt(_('No repository selected'),   _('Select a peer repository to compare with'),   self).run() - combo.get_child().grab_focus() + self.pathentry.grab_focus()   return   opts = ['--outgoing', path]   dlg = hgemail.EmailDialog(self.repo.root, opts)   self.show_dialog(dlg)   - def push_clicked(self, toolbutton, combo): - entry = combo.get_child() - remote_path = hglib.fromutf(entry.get_text()).strip() + def push_clicked(self, toolbutton): + 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 @@ -1122,7 +1140,7 @@
  self.reload_log()     def conf_clicked(self, toolbutton, combo): - newpath = hglib.fromutf(combo.get_child().get_text()).strip() + newpath = hglib.fromutf(self.pathentry.get_text()).strip()   for alias, path in self.repo.ui.configitems('paths'):   if newpath in (path, url.hidepassword(path)):   newpath = None