Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

update: make -C label more descriptive

Changeset 1ceb943dfbc9

Parent 0850fac729cb

by Steve Borho

Changes to one file · Browse files at 1ceb943dfbc9 Showing diff from parent 0850fac729cb Diff from another changeset...

Change 1 of 1 Show Changes Only hggtk/​update.py Stacked
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
 #  # update.py - TortoiseHg's dialog for updating repo  #  # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>  #    import os  import sys  import gtk  from dialog import error_dialog  from mercurial import util, hg, ui  from mercurial.node import short, nullrev  from mercurial.i18n import _  import hglib  import shlib  import hgcmd  import gdialog    _branch_tip_ = _('= Current Branch Tip =')    class UpdateDialog(gtk.Window):   """ Dialog to update Mercurial repo """   def __init__(self, rev=None):   """ Initialize the Dialog """   gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)   shlib.set_tortoise_icon(self, 'menucheckout.ico')   shlib.set_tortoise_keys(self)     self.set_default_size(350, 120)   self.notify_func = None     try:   repo = hg.repository(ui.ui(), path=hglib.rootpath())   except hglib.RepoError:   gobject.idle_add(self.destroy)   return     title = _('Update - %s') % hglib.toutf(os.path.basename(repo.root))   self.set_title(title)     vbox = gtk.VBox()   self.add(vbox)     hbox = gtk.HBox()   lbl = gtk.Label(_('Update to:'))   hbox.pack_start(lbl, False, False, 2)     # revisions combo box   combo = gtk.combo_box_new_text()   hbox.pack_start(combo, True, True, 2)   vbox.pack_start(hbox, False, False, 10)   if rev:   combo.append_text(str(rev))   else:   combo.append_text(_branch_tip_)   combo.set_active(0)   for b in repo.branchtags():   combo.append_text(b)   tags = list(repo.tags())   tags.sort()   tags.reverse()   for t in tags:   combo.append_text(t)   - self.overwrite = gtk.CheckButton(_('Overwrite local changes')) + self.overwrite = gtk.CheckButton(_('Overwrite local changes (--clean)'))   vbox.pack_start(self.overwrite, False, False, 10)     hbbox = gtk.HButtonBox()   hbbox.set_layout(gtk.BUTTONBOX_END)   vbox.pack_start(hbbox, False, False, 2)   close = gtk.Button(_('Close'))   close.connect('clicked', lambda x: self.destroy())     accelgroup = gtk.AccelGroup()   self.add_accel_group(accelgroup)   key, modifier = gtk.accelerator_parse('Escape')   close.add_accelerator('clicked', accelgroup, key, 0,   gtk.ACCEL_VISIBLE)   hbbox.add(close)     update = gtk.Button(_('Update'))   update.connect('clicked', self.update, combo, repo)   mod = shlib.get_thg_modifier()   key, modifier = gtk.accelerator_parse(mod+'Return')   update.add_accelerator('clicked', accelgroup, key, modifier,   gtk.ACCEL_VISIBLE)   hbbox.add(update)   update.grab_focus()     def update(self, button, combo, repo):   overwrite = self.overwrite.get_active()   rev = combo.get_active_text()     cmdline = ['hg', 'update', '--verbose']   if rev != _branch_tip_:   cmdline.append('--rev')   cmdline.append(rev)   if overwrite:   cmdline.append('--clean')   dlg = hgcmd.CmdDialog(cmdline)   dlg.run()   dlg.hide()   if self.notify_func:   self.notify_func(self.notify_args)   if dlg.returncode == 0:   self.destroy()     def set_notify_func(self, func, *args):   self.notify_func = func   self.notify_args = args    def run(ui, *pats, **opts):   return UpdateDialog(opts.get('rev'))