by
Changes to 7 files · Browse files at d2d1cf9d4760 Showing diff from parent b4e0431d279c f238bdefa6e6 Diff from another changeset...
@@ -458,12 +458,6 @@ self._ann_menu = create_menu('_annotate file', self._ann_file)
_menu.append(self._ann_menu)
_menu.append(create_menu('_revert file contents', self._revert_file))
- self._file_diff_to_mark_menu = create_menu('_diff file to mark',
- self._diff_file_to_mark)
- self._file_diff_from_mark_menu = create_menu('diff file _from mark',
- self._diff_file_from_mark)
- _menu.append(self._file_diff_to_mark_menu)
- _menu.append(self._file_diff_from_mark_menu)
_menu.show_all()
return _menu
@@ -600,12 +594,6 @@ def _file_popup_menu(self, treeview, button=0, time=0):
if self.curfile is None:
return
- if self.graphview:
- is_mark = self.graphview.get_mark_rev() is not None
- else:
- is_mark = False
- self._file_diff_to_mark_menu.set_sensitive(is_mark)
- self._file_diff_from_mark_menu.set_sensitive(is_mark)
self._filemenu.popup(None, None, None, button, time)
# If the filelog entry this changeset references does not link
@@ -659,41 +647,8 @@ self._node1, self._node2 = cmdutil.revpair(self.repo, [pair])
self._view_file('M', self.curfile, force_left=False)
- def _diff_file_to_mark(self, menuitem):
- '''User selected diff to mark from the file list context menu'''
- from status import GStatus
- from gtools import cmdtable
- rev0 = self.graphview.get_mark_rev()
- rev1 = self.currev
- statopts = self.merge_opts(cmdtable['gstatus|gst'][1],
- ('include', 'exclude', 'git'))
- statopts['rev'] = ['%u:%u' % (rev1, rev0)]
- statopts['modified'] = True
- statopts['added'] = True
- statopts['removed'] = True
- dialog = GStatus(self.ui, self.repo, self.cwd, [self.curfile],
- statopts, False)
- dialog.display()
- return True
-
- def _diff_file_from_mark(self, menuitem):
- '''User selected diff from mark from the file list context menu'''
- from status import GStatus
- from gtools import cmdtable
- rev0 = self.graphview.get_mark_rev()
- rev1 = self.currev
- statopts = self.merge_opts(cmdtable['gstatus|gst'][1],
- ('include', 'exclude', 'git'))
- statopts['rev'] = ['%u:%u' % (rev0, rev1)]
- statopts['modified'] = True
- statopts['added'] = True
- statopts['removed'] = True
- dialog = GStatus(self.ui, self.repo, self.cwd, [self.curfile],
- statopts, False)
- dialog.display()
-
def _ann_file(self, menuitem):
- '''User selected diff from mark from the file list context menu'''
+ '''User selected annotate file from the file list context menu'''
from datamine import DataMineDialog
rev = self.currev
dialog = DataMineDialog(self.ui, self.repo, self.cwd, [], {}, False)
|
@@ -110,8 +110,6 @@ revs = []
if self.currow is not None:
revs.append(self.currow[treemodel.REVID])
- if self.graphview.get_mark_rev() is not None:
- revs.append(self.graphview.get_mark_rev())
dlg = FilterDialog(self.repo.root, revs, self.pats,
filterfunc=do_reload)
@@ -316,7 +314,7 @@ def tree_context_menu(self):
_menu = gtk.Menu()
_menu.append(create_menu('di_splay', self._show_status))
- _menu.append(create_menu('_checkout', self._checkout))
+ _menu.append(create_menu('_update', self._checkout))
self._cmenu_merge = create_menu('_merge with', self._merge)
_menu.append(self._cmenu_merge)
_menu.append(create_menu('_export patch', self._export_patch))
@@ -479,10 +477,6 @@ self.opts['rev'] = ["%s:%s" % (rev0, rev1)]
self._diff_file(None, '')
- def _mark_rev(self, menuitem):
- rev = self.currow[treemodel.REVID]
- self.graphview.set_mark_rev(rev)
-
def _add_tag(self, menuitem):
from tagadd import TagAddDialog
|
@@ -8,6 +8,7 @@ """
import dumbdbm, anydbm
+saved_default = anydbm._defaultmod
anydbm._defaultmod = dumbdbm
import os
@@ -86,7 +87,18 @@
def read(self):
self._data.clear()
- if not os.path.exists(self._path):
+ if os.path.exists(self._path):
+ # One-time import of <=0.7 config file
+ anydbm._defaultmod = saved_default
+ dbase = shelve.open(self._path)
+ self._dbappname = dbase['APPNAME']
+ self.version = dbase['VERSION']
+ self._data.update(dbase.get('DATA', {}))
+ dbase.close()
+ anydbm._defaultmod = dumbdbm
+ os.unlink(self._path)
+ return
+ if not os.path.exists(self._path+'.dat'):
return
dbase = shelve.open(self._path)
|
|
@@ -155,8 +155,9 @@ revbox.pack_end(self._use_proxy, False, False)
vbox.pack_start(revbox, False, False, 2)
- expander = gtk.Expander('Advanced Options')
+ self.expander = expander = gtk.Expander('Advanced Options')
expander.set_expanded(False)
+ expander.connect_after('activate', self._expanded)
hbox = gtk.HBox()
expander.add(hbox)
@@ -216,6 +217,8 @@ vbox.pack_start(self.stbar, False, False, 2)
self.connect('map', self.update_buttons)
self._last_drop_time = None
+
+ self.load_settings()
def fill_path_combo(self):
self.pathlist.clear()
@@ -303,15 +306,24 @@
def _pull_menu(self):
menu = gtk.Menu()
-
- self._pull_fetch = gtk.CheckMenuItem("Do fetch")
- menu.append(self._pull_fetch)
- self._pull_update = gtk.CheckMenuItem("Update to new tip")
- menu.append(self._pull_update)
+
+ # define menu items
+ self._pull_default = gtk.RadioMenuItem(None, "Default Pull")
+ self._pull_update = gtk.RadioMenuItem(self._pull_default, "Update to new tip")
+ self._pull_fetch = gtk.RadioMenuItem(self._pull_default, "Do fetch")
+ self._pull_menu_items = [
+ self._pull_default,
+ self._pull_update,
+ self._pull_fetch,
+ ]
+
+ # add them to the menu
+ for item in self._pull_menu_items:
+ menu.append(item)
# restore states from previous session
- st = self._settings.get_value('_pull_update_state', False)
- self._pull_update.set_active(st)
+ st = self._settings.get_value('_pull_default_state', 0)
+ self._pull_menu_items[st].set_active(True)
menu.show_all()
return menu
@@ -379,8 +391,11 @@ gtk.main_quit()
def _save_settings(self):
- self._settings.set_value('_pull_update_state',
- self._pull_update.get_active())
+ self.update_settings()
+ pullstate = 0
+ for i in xrange(0, len(self._pull_menu_items)):
+ if self._pull_menu_items[i].get_active(): pullstate = i
+ self._settings.set_value('_pull_default_state', pullstate)
self._settings.write()
def _delete(self, widget, event):
@@ -572,6 +587,32 @@ if self.hgthread.return_code() is None:
self.write("[command interrupted]")
return False # Stop polling this function
+
+ AdvancedDefaults = {
+ 'expander.expanded': False,
+ '_reventry.text': '',
+ '_force.active': False,
+ '_showpatch.active': False,
+ '_newestfirst.active': False,
+ '_nomerge.active': False,}
+
+ def _expanded(self, expander):
+ if not expander.get_expanded():
+ self.load_settings(SynchDialog.AdvancedDefaults.get)
+
+ def load_settings(self, get_value = None):
+ get_value = get_value or self._settings.get_value
+ for key, default in SynchDialog.AdvancedDefaults.iteritems():
+ member, attr = key.split('.')
+ value = get_value(key, default)
+ getattr(getattr(self, member), 'set_%s'%attr)(value)
+
+ def update_settings(self, set_value = None):
+ set_value = set_value or self._settings.set_value
+ for key, default in SynchDialog.AdvancedDefaults.iteritems():
+ member, attr = key.split('.')
+ value = getattr(getattr(self, member), 'get_%s'%attr)()
+ set_value(key, value)
def run(cwd='', root='', files=[], pushmode=False, **opts):
dialog = SynchDialog(cwd, root, files, pushmode)
|
@@ -31,13 +31,13 @@ ('CLI Editor', 'ui.editor', [],
'The editor to use during a commit and other'
' instances where Mercurial needs multiline input from'
- ' the user. Only used by CLI commands.'),
+ ' the user. Only used by command line interface commands.'),
('Tab Width', 'tortoisehg.tabwidth', [],
'Specify the number of spaces to expand tabs.'
' Default: Not expanded'),
('Bottom Diffs', 'gtools.diffbottom', ['False', 'True'],
'Show the diff panel below the file list in status, shelve, and'
- ' commit dialogs. Default: False'),
+ ' commit dialogs. Default: False (show diffs to right of file list)'),
('Overlay Icons', 'tortoisehg.overlayicons',
['False', 'True', 'localdisks'],
'Display overlay icons in Explorer windows.'
@@ -47,8 +47,8 @@ ('Username', 'ui.username', [],
'Name associated with commits'),
('External Commit Tool', 'tortoisehg.extcommit', ['None', 'qct'],
- 'Select commit tool launched by TortoiseHg. Qct must must be'
- ' installed separately. Default: None'))
+ 'Select commit tool launched by TortoiseHg. Qct is no longer'
+ ' included. Default: None (use the builtin tool)'))
_log_info = (
('Author Coloring', 'tortoisehg.authorcolor', ['False', 'True'],
@@ -56,7 +56,7 @@ ' the changes are colored green for merge, red for'
' non-trivial parents, black for normal. Default: False'),
('Long Summary', 'tortoisehg.longsummary', ['False', 'True'],
- 'Concatenate multiple lines of changeset summary'
+ 'If true, concatenate multiple lines of changeset summary'
' until they reach 80 characters. Default: False'),
('Log Batch Size', 'tortoisehg.graphlimit', ['500'],
'The number of revisions to read and display in the'
@@ -119,16 +119,16 @@ 'Character encoding name'))
_proxy_info = (
- ('host', 'http_proxy.host', [],
+ ('Host', 'http_proxy.host', [],
'Host name and (optional) port of proxy server, for'
' example "myproxy:8000"'),
- ('no', 'http_proxy.no', [],
+ ('Bypass List', 'http_proxy.no', [],
'Optional. Comma-separated list of host names that'
' should bypass the proxy'),
- ('passwd', 'http_proxy.passwd', [],
+ ('Password', 'http_proxy.passwd', [],
'Optional. Password to authenticate with at the'
' proxy server'),
- ('user', 'http_proxy.user', [],
+ ('User', 'http_proxy.user', [],
'Optional. User name to authenticate with at the'
' proxy server'))
@@ -159,22 +159,23 @@ ('SMTP Password', 'smtp.password', [],
'Password to authenticate to SMTP server with'),
('Local Hostname', 'smtp.local_hostname', [],
- 'Hostname the sender can use to identify itself to MTA'))
+ 'Hostname the sender can use to identify itself to the mail '
+ ' transfer agent.'))
_diff_info = (
('Git Format', 'diff.git', ['False', 'True'],
- 'Use git extended diff format.'),
+ 'Use git extended diff header format. Default: False'),
('No Dates', 'diff.nodates', ['False', 'True'],
- 'Do no include dates in diff headers.'),
+ 'Do not include modification dates in diff headers. Default: False'),
('Show Function', 'diff.showfunc', ['False', 'True'],
- 'Show which function each change is in.'),
+ 'Show which function each change is in. Default: False'),
('Ignore White Space', 'diff.ignorews', ['False', 'True'],
- 'Ignore white space when comparing lines.'),
+ 'Ignore white space when comparing lines. Default: False'),
('Ignore WS Amount', 'diff.ignorewsamount', ['False', 'True'],
- 'Ignore changes in the amount of white space.'),
+ 'Ignore changes in the amount of white space. Default: False'),
('Ignore Blank Lines', 'diff.ignoreblanklines',
['False', 'True'],
- 'Ignore changes whose lines are all blank.'))
+ 'Ignore changes whose lines are all blank. Default: False'))
class ConfigDialog(gtk.Dialog):
def __init__(self, root='',
|
@@ -40,9 +40,8 @@ WCPARENT = 9
HEAD = 10
TAGS = 11
-MARKED = 12
-FGCOLOR = 13
-HEXID = 14
+FGCOLOR = 12
+HEXID = 13
class TreeModel(gtk.GenericTreeModel):
@@ -75,7 +74,6 @@ if index == WCPARENT: return gobject.TYPE_BOOLEAN
if index == HEAD: return gobject.TYPE_BOOLEAN
if index == TAGS: return gobject.TYPE_STRING
- if index == MARKED: return gobject.TYPE_BOOLEAN
if index == FGCOLOR: return gobject.TYPE_STRING
if index == HEXID: return gobject.TYPE_STRING
@@ -143,15 +141,13 @@
revision = (None, node, revid, None, sumstr,
author, date, None, parents, wc_parent, head, taglist,
- None, color, short(node))
+ color, short(node))
self.revisions[revid] = revision
else:
revision = self.revisions[revid]
if column == REVISION:
return revision
- if column == MARKED:
- return revid == self.marked_rev
return revision[column]
def on_iter_next(self, rowref):
|
@@ -80,7 +80,6 @@ self.batchsize = limit
self.repo = repo
self.currev = None
- self.marked_rev = None
self.construct_treeview()
self.pbar = pbar
@@ -166,7 +165,6 @@ self.model = treemodel.TreeModel(self.repo, self.graphdata,
self.color_func)
self.treeview.set_model(self.model)
- self.model.marked_rev = self.marked_rev
self.graph_cell.columns_len = self.max_cols
width = self.graph_cell.get_size(self.treeview)[2]
@@ -333,27 +331,16 @@ self.treeview.append_column(self.id_column)
cell = gtk.CellRendererText()
- mcell = gtk.CellRendererPixbuf()
- pcell = gtk.CellRendererPixbuf()
- hcell = gtk.CellRendererPixbuf()
cell.set_property("width-chars", 65)
cell.set_property("ellipsize", pango.ELLIPSIZE_END)
self.msg_column = gtk.TreeViewColumn("Summary")
self.msg_column.set_resizable(True)
self.msg_column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
self.msg_column.set_fixed_width(cell.get_size(self.treeview)[2])
- self.msg_column.pack_start(mcell, expand=False)
- self.msg_column.pack_start(pcell, expand=False)
- self.msg_column.pack_start(hcell, expand=False)
self.msg_column.pack_end(cell, expand=True)
self.msg_column.add_attribute(cell, "foreground", treemodel.FGCOLOR)
self.msg_column.add_attribute(cell, "markup", treemodel.MESSAGE)
- self.msg_column.add_attribute(pcell, "visible", treemodel.WCPARENT)
- self.msg_column.add_attribute(hcell, "visible", treemodel.HEAD)
- self.msg_column.add_attribute(mcell, "visible", treemodel.MARKED)
- mcell.set_property('stock-id', gtk.STOCK_GO_FORWARD)
- pcell.set_property('stock-id', gtk.STOCK_HOME)
- hcell.set_property('stock-id', gtk.STOCK_EXECUTE)
+ self.msg_column.add_attribute(cell, "underline", treemodel.WCPARENT)
self.treeview.append_column(self.msg_column)
cell = gtk.CellRendererText()
@@ -382,16 +369,6 @@ self.date_column.add_attribute(cell, "foreground", treemodel.FGCOLOR)
self.treeview.append_column(self.date_column)
- def set_mark_rev(self, rev):
- '''User has marked a revision for diff'''
- self.marked_rev = long(rev)
- self.msg_column.queue_resize()
- if self.model:
- self.model.marked_rev = self.marked_rev
-
- def get_mark_rev(self):
- return self.marked_rev
-
def text_color_orig(self, parents, rev, author):
if len(parents) == 2:
# mark merge changesets green
|
Loading...