Changeset a2dd1d3959eb…
Parent 412e1e00ffe0…
by
Changes to 2 files · Browse files at a2dd1d3959eb Showing diff from parent 412e1e00ffe0 Diff from another changeset...
@@ -77,13 +77,12 @@ self.refresh_clicked,
tip=_('Reload revision history')),
gtk.SeparatorToolItem(),
+ self.make_toolbutton(gtk.STOCK_NETWORK,
+ _('Synchronize'),
+ self.synch_clicked,
+ tip=_('Launch synchronize tool')),
+ gtk.SeparatorToolItem(),
]
- if not self.opts.get('from-synch'):
- self.synctb = self.make_toolbutton(gtk.STOCK_NETWORK,
- _('Synchronize'),
- self.synch_clicked,
- tip=_('Launch synchronize tool'))
- tbar += [self.synctb, gtk.SeparatorToolItem()]
if 'mq' in self.exs:
self.mqtb = self.make_toolbutton(gtk.STOCK_DIRECTORY,
_('MQ'),
@@ -154,7 +153,7 @@
def synch_clicked(self, toolbutton, data):
def sync_closed(dialog):
- self.synctb.set_sensitive(True)
+ self.get_toolbutton(_('Synchronize')).set_sensitive(True)
def synch_callback(parents):
self.repo.invalidate()
@@ -164,11 +163,11 @@
from tortoisehg.hgtk import synch
parents = [x.node() for x in self.repo.parents()]
- dlg = synch.SynchDialog([], False, True)
+ dlg = synch.SynchDialog([], False)
dlg.set_notify_func(synch_callback, parents)
dlg.connect('destroy', sync_closed)
dlg.show_all()
- self.synctb.set_sensitive(False)
+ self.get_toolbutton(_('Synchronize')).set_sensitive(False)
def toggle_view_column(self, button, property):
active = button.get_active()
@@ -374,7 +373,7 @@ root = self.repo.root
os.chdir(root) # for paths relative to repo root
- self.origtip = self.opts['orig-tip'] or len(self.repo)
+ self.origtip = len(self.repo)
self.graphview.set_property('branch-color', self.branch_color)
# ignore file patterns that imply repo root
@@ -1547,8 +1546,8 @@ 'follow':False, 'follow-first':False, 'copies':False, 'keyword':[],
'limit':0, 'rev':[], 'removed':False, 'no_merges':False,
'date':None, 'only_merges':None, 'prune':[], 'git':False,
- 'verbose':False, 'include':[], 'exclude':[], 'from-synch':False,
- 'orig-tip':None, 'filehist':None, 'canonpats':[]
+ 'verbose':False, 'include':[], 'exclude':[], 'filehist':None,
+ 'canonpats':[]
}
cmdoptions.update(opts)
pats = hglib.canonpaths(pats) + cmdoptions['canonpats']
|
@@ -20,11 +20,11 @@ from tortoisehg.util.i18n import _
from tortoisehg.util import hglib, settings, paths
-from tortoisehg.hgtk import dialog, gtklib, hgthread, history, thgconfig
+from tortoisehg.hgtk import dialog, gtklib, hgthread, thgconfig
from tortoisehg.hgtk import thgshelve, hgemail, update
class SynchDialog(gtk.Window):
- def __init__(self, repos=[], pushmode=False, fromlog=False):
+ def __init__(self, repos=[], pushmode=False):
""" Initialize the Dialog. """
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
gtklib.set_tortoise_icon(self, 'menusynch.ico')
@@ -33,7 +33,6 @@ self.root = paths.find_root()
self.selected_path = None
self.hgthread = None
- self.fromlog = fromlog
self.notify_func = None
self.last_drop_time = None
self.lastcmd = []
@@ -49,7 +48,6 @@ self.set_default_size(655, 552)
self.paths = self.get_paths()
- self.origchangecount = len(self.repo)
name = self.repo.ui.config('web', 'name') or os.path.basename(self.root)
self.set_title(_('TortoiseHg Synchronize - ') + hglib.toutf(name))
@@ -269,11 +267,8 @@
def create_bottombox(self):
self.buttonhbox = gtk.HBox()
- self.viewpulled = gtk.Button(_('View pulled revisions'))
- self.viewpulled.connect('clicked', self._view_pulled_changes)
self.updatetip = gtk.Button(_('Update to branch tip'))
self.updatetip.connect('clicked', self._update_to_tip)
- self.buttonhbox.pack_start(self.viewpulled, False, False, 2)
self.buttonhbox.pack_start(self.updatetip, False, False, 2)
self.basevbox.pack_start(self.buttonhbox, False, False, 2)
@@ -333,39 +328,21 @@ self.pathtext.set_text(hglib.toutf(path))
def update_buttons(self):
- self.buttonhbox.hide()
try:
# open a new repo, rebase can confuse cached repo
repo = hg.repository(ui.ui(), path=self.root)
except hglib.RepoError:
return
- tip = len(repo)
- if ' '.join(self.lastcmd[:2]) == 'pull --rebase':
- # if last operation was a rebase, do not show 'viewpulled'
- # and reset our remembered tip changeset
- self.origchangecount = tip
- self.viewpulled.hide()
- elif self.origchangecount == tip or self.fromlog:
- self.viewpulled.hide()
+
+ wc = repo[None]
+ bhead = repo.branchtags().get(wc.branch())
+ parents = repo.parents()
+ if len(parents) > 1 or parents[0].node() == bhead or not bhead:
+ self.buttonhbox.hide()
else:
self.buttonhbox.show()
- self.viewpulled.show()
-
- wc = repo[None]
- branchhead = repo.branchtags().get(wc.branch())
- parents = repo.parents()
- if len(parents) > 1 or parents[0].node() == branchhead or not branchhead:
- self.updatetip.hide()
- else:
- self.buttonhbox.show()
- self.updatetip.show()
self.repo = repo
- def _view_pulled_changes(self, button):
- opts = {'orig-tip' : self.origchangecount, 'from-synch' : True}
- dlg = history.run(self.ui, **opts)
- dlg.display()
-
def _update_to_tip(self, button):
def update_notify(arg):
if self.notify_func:
|
Loading...