by
Changes to 24 files · Browse files at a461a895d4ca Showing diff from parent 81e9adc8efb2 d2ec324d789c Diff from another changeset...
|
@@ -100,7 +100,7 @@ ; Linux only diff tools, listed here for reference
bcompare.priority=-1
bcompare.args=$local $other $base -mergeoutput=$output -ro -lefttitle=parent1 -centertitle=base -righttitle=parent2 -outputtitle=merged -automerge -reviewconflicts -solo
-beyondcompare3.premerge=False
+bcompare.premerge=False
bcompare.gui=True
bcompare.diffargs=-lro -lefttitle='$plabel1' -righttitle='$clabel' -solo -expandall $parent $child
bcompare.diff3args=$parent1 $parent2 $child -lefttitle='$plabel1' -centertitle='$clabel' -righttitle='$plabel2' -solo -expandall
|
@@ -56,6 +56,7 @@ ;pager =
;parentrevspec =
;patchbomb =
+;progress =
;purge =
;rebase =
;record =
@@ -67,6 +68,9 @@; Extra extensions bundled with TortoiseHg
;fold =
;hgcr-gui =
+;perfarce =
+;hgeol =
+;mercurial_keyring =
;
; Define external diff commands, for hg command line use only
|
|
@@ -1,5 +0,0 @@ - ; User specific Mercurial config file.
-; See the hgrc man page for details.
-
-[ui]
-username = {hgusername}
|
@@ -33,6 +33,7 @@ echo.and where ^<lang^> is one of
echo. en to make target in English ^(default^)
echo. ja to make target in Japanese
+ echo. cs to make target in Czech
goto end
)
|
|
@@ -1,4 +1,4 @@ - Klonování repozitáře
+Klonování repozitáře
====================
.. module:: clone.dialog
|
|
|
|
@@ -1,200 +1,190 @@ - # -*- coding: utf-8 -*-
-#
-# thg_doc documentation build configuration file, created by
-# sphinx-quickstart on Thu Dec 03 19:01:03 2009.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys, os
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.append(os.path.abspath('.'))
-
-# -- General configuration -----------------------------------------------------
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['.templates']
-
-# The suffix of source filenames.
-source_suffix = '.txt'
-
-# The encoding of source files.
-source_encoding = 'utf-8'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'TortoiseHg'
-copyright = u'2009, Steve Borho and others'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = '0.10'
-# The full version, including alpha/beta/rc tags.
-release = '0.10.0'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-language = 'cs'
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of documents that shouldn't be included in the build.
-#unused_docs = []
-
-# List of directories, relative to source directory, that shouldn't be searched
-# for source files.
-exclude_trees = []
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Options for HTML output ---------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. Major themes that come with
-# Sphinx are currently 'default' and 'sphinxdoc'.
-#html_theme = 'default'
-html_style = 'default.css'
-# Theme options are theme-specific and customize the look and feel of a theme
-# further. For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-html_logo = 'figures/thg_logo_95x50.png'
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['.static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_use_modindex = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = ''
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'TortoiseHg'
-
-
-# -- Options for LaTeX output --------------------------------------------------
-
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
- ('index', 'TortoiseHg.tex', ur'TortoiseHg Documentation',
- ur'Steve Borho and others', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-latex_logo = 'figures/thg_logo_pdf.png'
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_use_modindex = True
+# -*- coding: utf-8 -*-
+#
+# TortoiseHg documentation build configuration file, created by
+# sphinx-quickstart on Tue Jul 21 23:42:44 2009.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# The contents of this file are pickled, so don't put values in the namespace
+# that aren't pickleable (module imports are okay, they're removed automatically).
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If your extensions (or modules documented by autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.append(os.path.abspath('.'))
+
+# General configuration
+# ---------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['.templates']
+
+# The suffix of source filenames.
+source_suffix = '.txt'
+
+# The encoding of source files.
+source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'TortoiseHg'
+copyright = u'2010, Steve Borho and others'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.10'
+# The full version, including alpha/beta/rc tags.
+release = '0.10.0'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+language = 'cs'
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_trees = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+
+# Options for HTML output
+# -----------------------
+
+# The style sheet to use for HTML and HTML Help pages. A file of that name
+# must exist either in Sphinx' static/ path, or in one of the custom paths
+# given in html_static_path.
+html_style = 'default.css'
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+html_logo = 'figures/thg_logo_92x50.png'
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['.static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, the reST sources are included in the HTML build as _sources/<name>.
+#html_copy_source = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'TortoiseHg'
+
+
+# Options for LaTeX output
+# ------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, document class [howto/manual]).
+latex_documents = [
+ ('index', 'TortoiseHg.tex', ur'TortoiseHg Documentation',
+ ur'Steve Borho and others', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+latex_logo = 'figures/thg_logo_pdf.png'
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = ['faq']
+
+# If false, no module index is generated.
+#latex_use_modindex = True
|
|
|
- Zkoumání dat
+Zkoumání dat
============
.. module:: datamine.dialog
:synopsis: Dialog used to search repository history
Aplikace datamine (zkoumání dat) se používá k inspekci revizí v repozitáři. Okno má implicitně otevřenou záložku *Hledat* a vyvolatelnou záložku *Anotace*.
Záložka Hledat
--------------
.. figure:: figures/search.png
:alt: Search dialog
Okno se záložkou Hledat
Záložka Hledat se používá pro vyhledávání (*grep*) souborů podle klíčových slov, proměnných, funkcí, atp v histori repozitáře.
Pole pro zadávání textu mají tyto významy:
:guilabel:`Regexp`
Regulární výraz vyhledávacího kritéria.
:guilabel:`Zahrnuje`
CSV seznam cest, které mají do vyhledávání být zahrnuty. Není-li žádná cesta zadána, předpokládá se hledání v celém repozitáři. Zadání cesty tedy zužuje vyhledávací kriteria.
:guilabel:`Vylučuje`
CSV seznam cest, které mají být vyloučeny z vyhledávání. Tento vyčleňovací filtr je použit po předchozím začleňovacím filtru.
Zatržítka pod textovými poli:
:guilabel:`Kopie a změny jmen`
Prohledávat kopie a přejmenované soubory neuvedené v inkluzivním výběru
:guilabel:`Ignorovat velikost pímen`
Nezohledňovat velikost písmen při hledání
:guilabel:`Zobrazit čísla řádků`
Zobrazit číslo řádku na počátku vyhledaného řádku
:guilabel:`Zobrazit všechny shodné revize`
Zobrazit každý případ shody vyhledávacího kriteria s jeho výskytem v řádku, nikoliv jenom u poslední revize. Znaménka +/- říkají, zda vyhledávaný text byl v této změně přidán či odejmut.
Záložky 'hledat' jsou pojmenovány podle posledně použitého vyhledávacího řetězce. Tlačítko :guilabel:`Nové hledání` samozřejmě otevře novou záložku 'hledat' a tlačítko :guilabel:`Stop` ukončí právě probíhající hledání (toto tlačítko je aktivní jenom při probíhajícím hledání).
V okně záložky hledat se vypíše seznam souborů s nalezenou shodou. Popisný tooltip poskytne u každého řádku další informaci (autor, datum/čas, shrnutí).
Dvojklik na označeném řádku otevře podrobné zobrazení vybraného changesetu.
Pravý klik na řádku otevře kontextovou nabídku s těmito položkami:
:guilabel:`zobrazit changeset`
otevřít okno s podrobným zobrazením changesetu
:guilabel:`annotace souboru`
otevřít anotační záložku pro daný soubor a revizi
:guilabel:`historie souboru`
otevřít průzkumník repozitáře s revizemi souboru
:guilabel:`otevřít revizi souboru`
otevřít aktuální stav souboru dané revize v nastaveném textovém editoru
Anotační záložky
----------------
.. figure:: figures/annotate.png
:alt: Annotate tabs
Anotační záložka
Anotační záložka se aktivuje z kontextového menu nad vybraným souborem v záložce "hledat".
Těchto záložek je možné otevřít celou řadu, účelné je otevřít pro každý soubor záložky 'hledat' jednu záložku anotační.
Anotační záložka má dva panely. V horním panelu je graf a seznam revizí vybraného souboru. Pro každou revizi lze dvojklikem aktualizovat anotaci ve spodním panelu a obráceně - pro každý řádek anotace lze dvojklikem zvýraznit odpovídající revizi v horním panelu.
U obou panelů lze pravým klikem otevřít kontextovou nabídku s položkami: zoom ke změně, zobrazit changeset, anotace rodiče, otevřít revizi souboru a historie souboru. Je to podobná nabídka jako v záložce 'hledat'.
Barevné schema anotačního panelu je dvojrozměrné. Barva řádku se mění podle autora, sytost podle stáří změny. Čím je změna starší, tím je zabarvení světlejší.
Pravým klikem na záhlaví sloupců v anotačním panelu lze přidat další sloupce :guilabel:`Jméno souboru` a :guilabel:`Uživatel`.
Sledování změny jmen
^^^^^^^^^^^^^^^^^^^^
Anotační data sledují automaticky řádky kódu zpět zkrz kopie a změny jmen až k původnímu changesetu, který změnu zavedl.
Panel se zobrazením grafu se rovněž pokouší sledovat změny jmen a kopie takže některé řádky v tomto panelu mohou korelovat s jinými jmény souborů než původní anotovaná cesta k souboru.
Změny jmen jsou v grafu vyznačeny barevně.
Nastavitelné parametry
^^^^^^^^^^^^^^^^^^^^^^
Anotační záložky lze konfigurovat v okně Nastavení ..., který byl primárně definován pro jiné nástroje:
:menuselection:`Changelog -> Zabarvení podle autora`
Měnit zabarvení větve grafu podle autora
:menuselection:`Changelog -> Dlouhý souhrn`
Spojuje řádky zprávy komitu do délky 80 znaků.
:menuselection:`TortoiseHg -> Šířka záložky`
Počet míst pro šířku záložek
Spuštění z příkazového řádku
----------------------------
::
hgtk datamine
aliasy: annotate, blame
repository search and annotate tool
globální možnosti viz "hgtk -v help datamine"
.. vim: noet ts=4
|
|
|
@@ -1,4 +1,4 @@ - **************************
+**************************
Frequently Asked Questions
**************************
|
@@ -1,7 +1,7 @@ - .. TortoiseHg documentation master file, created by
+.. TortoiseHg documentation master file, created by
sphinx-quickstart on Tue Jul 21 13:14:26 2009.
- You can adapt this file completely to your liking, but it should at least contain the root
- `toctree` directive.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
Vítejte v dokumentaci pro TortoiseHg!
======================================
@@ -9,19 +9,19 @@Obsah:
.. toctree::
- :maxdepth: 3
- :numbered:
-
- preface
- intro
- quick
- daily
- settings
- recovery
- patches
- extensions
- faq
- debugging
+ :maxdepth: 3
+ :numbered:
+
+ preface
+ intro
+ quick
+ daily
+ settings
+ recovery
+ patches
+ extensions
+ faq
+ debugging
Indices and tables
==================
|
@@ -1,4 +1,4 @@ - Vytvoření nového repozitáře
+Vytvoření nového repozitáře
===========================
.. module:: init.dialog
|
|
|
|
|
|
@@ -768,8 +768,11 @@
(frame, treeview, origpath, graphview) = objs
q = Queue.Queue()
- args = [q, 'annotate', '--follow', '--number',
- '--rev', str(rev), 'path:'+path]
+ # Use short -f here because it's meaning has changed, it used
+ # to be --follow but now it means --file. We want either.
+ # Replace -f with --file when support for hg-1.4 is dropped
+ args = [q, 'annotate', '-f', '--number', '--rev', str(rev),
+ 'path:'+path]
thread = thread2.Thread(target=threadfunc, args=args)
thread.start()
frame._mythread = thread
|
@@ -127,12 +127,15 @@ self.stdoutq.put(o)
else:
break
- self.oldstdout = os.dup(sys.__stdout__.fileno())
self.stdoutq = Queue.Queue()
- self.readfd, writefd = os.pipe()
- os.dup2(writefd, sys.__stdout__.fileno())
- thread = threading.Thread(target=pollstdout, args=[])
- thread.start()
+ if os.name == 'nt':
+ # Only capture stdout on Windows. This causes hard crashes
+ # on some other platforms. See issue #783
+ self.readfd, writefd = os.pipe()
+ self.oldstdout = os.dup(sys.__stdout__.fileno())
+ os.dup2(writefd, sys.__stdout__.fileno())
+ thread = threading.Thread(target=pollstdout, args=[])
+ thread.start()
self.hgthread = hgthread.HgThread(self.cmdline[1:])
self.hgthread.start()
@@ -192,8 +195,9 @@ self._button_stop.set_sensitive(False)
self._button_ok.set_sensitive(True)
self._button_ok.grab_focus()
- os.dup2(self.oldstdout, sys.__stdout__.fileno())
- os.close(self.oldstdout)
+ if os.name == 'nt':
+ os.dup2(self.oldstdout, sys.__stdout__.fileno())
+ os.close(self.oldstdout)
return False # Stop polling this function
else:
return True
|
|
|
@@ -10,7 +10,7 @@ import gtk
import traceback
-from mercurial import hg, ui, util
+from mercurial import hg, ui, util, error
from tortoisehg.util.i18n import _
from tortoisehg.util import hglib, settings, i18n
@@ -36,8 +36,8 @@ self.repo = repo
# add buttons
- self.add_button(_('Add'), RESPONSE_ADD)
- self.add_button(_('Remove'), RESPONSE_REMOVE)
+ self.addbtn = self.add_button(_('Add'), RESPONSE_ADD)
+ self.removebtn = self.add_button(_('Remove'), RESPONSE_REMOVE)
self.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)
# persistent settings
@@ -51,15 +51,18 @@ self.tagcombo = gtk.combo_box_entry_new_text()
self.tagentry = self.tagcombo.get_child()
self.tagentry.set_text(hglib.toutf(tag))
+ self.tagcombo.connect('changed', self.combo_changed)
self.tagentry.connect('activate',
lambda *a: self.response(RESPONSE_ADD))
table.add_row(_('Tag:'), self.tagcombo, padding=False)
## revision input
- self._rev_input = gtk.Entry()
- self._rev_input.set_width_chars(12)
- self._rev_input.set_text(rev)
- table.add_row(_('Revision:'), self._rev_input)
+ self.reventry = gtk.Entry()
+ self.reventry.set_width_chars(12)
+ self.reventry.set_text(rev)
+ self.reventry.connect('notify::text',
+ lambda *a: self.update_sensitives())
+ table.add_row(_('Revision:'), self.reventry)
# advanced options expander
self.expander = gtk.Expander(_('Advanced options'))
@@ -70,80 +73,126 @@ self.expander.add(table)
## tagging options
- self._local_tag = gtk.CheckButton(_('Tag is local'))
- self._local_tag.connect('toggled', self.local_tag_toggled)
- self._replace_tag = gtk.CheckButton(_('Replace existing tag'))
- self._eng_msg = gtk.CheckButton(_('Use English commit message'))
- table.add_row(self._local_tag)
- table.add_row(self._replace_tag)
- table.add_row(self._eng_msg)
+ self.localchk = gtk.CheckButton(_('Tag is local'))
+ self.localchk.connect('toggled', self.local_tag_toggled)
+ self.replacechk = gtk.CheckButton(_('Replace existing tag'))
+ self.replacechk.connect('toggled',
+ lambda *a: self.update_sensitives())
+ self.engchk = gtk.CheckButton(_('Use English commit message'))
+ table.add_row(self.localchk)
+ table.add_row(self.replacechk)
+ table.add_row(self.engchk)
## custom commit message
- self._use_msg = gtk.CheckButton(_('Use custom commit message:'))
- self._use_msg.connect('toggled', self.msg_toggled)
- self._commit_message = gtk.Entry()
- self._commit_message.set_sensitive(False)
- table.add_row(self._use_msg)
- table.add_row(self._commit_message, padding=False)
+ self.customchk = gtk.CheckButton(_('Use custom commit message:'))
+ self.customchk.connect('toggled', self.msg_toggled)
+ self.msgentry = gtk.Entry()
+ self.msgentry.set_sensitive(False)
+ table.add_row(self.customchk)
+ table.add_row(self.msgentry, padding=False)
# prepare to show
self.load_settings()
- self._refresh(clear=False)
+ self.update_tagcombo(clear=False)
+ self.update_sensitives(True)
self.tagentry.grab_focus()
- def _refresh(self, clear=True):
+ def update_tagcombo(self, clear=True):
""" update display on dialog with recent repo data """
self.repo.invalidate()
self.tagcombo.get_model().clear()
# add tags to drop-down list
- tags = [x[0] for x in self.repo.tagslist()]
+ tags = list(self.repo.tags())
tags.sort()
- for tagname in tags:
- if tagname == 'tip':
+ tags.reverse()
+ for tag in tags:
+ if tag == 'tip':
continue
- self.tagcombo.append_text(hglib.toutf(tagname))
+ self.tagcombo.append_text(hglib.toutf(tag))
# clear tag input
if clear:
self.tagentry.set_text('')
+ def update_revision(self):
+ """ update revision entry based on tag """
+ tagmap = self.repo.tags()
+ tag = self.tagentry.get_text()
+ if not tag or hglib.fromutf(tag) not in tagmap:
+ return
+
+ node = tagmap[hglib.fromutf(tag)]
+ ctx = self.repo[node]
+ self.reventry.set_text(str(ctx.rev()))
+
+ def update_sensitives(self, affectlocal=False):
+ """ update bottom button sensitives based on rev and tag """
+ rev = self.reventry.get_text()
+ tag = self.tagentry.get_text()
+ if not rev or not tag:
+ self.addbtn.set_sensitive(False)
+ self.removebtn.set_sensitive(False)
+ return
+
+ # check if valid revision
+ try:
+ self.repo[hglib.fromutf(rev)]
+ except (error.LookupError, error.RepoLookupError, error.RepoError):
+ self.addbtn.set_sensitive(False)
+ self.removebtn.set_sensitive(False)
+ return
+ # check tag existence
+ force = self.replacechk.get_active()
+ is_exist = hglib.fromutf(tag) in self.repo.tags()
+ self.addbtn.set_sensitive(not is_exist or force)
+ self.removebtn.set_sensitive(is_exist)
+
+ # check if local
+ is_local = self.repo.tagtype(hglib.fromutf(tag))
+ if affectlocal and is_local is not None:
+ self.localchk.set_active(is_local == 'local')
+
def load_settings(self):
expanded = self.settings.get_value('expanded', False, True)
self.expander.set_property('expanded', expanded)
checked = self.settings.get_value('english', False, True)
- self._eng_msg.set_active(checked)
+ self.engchk.set_active(checked)
def store_settings(self):
expanded = self.expander.get_property('expanded')
self.settings.set_value('expanded', expanded)
- checked = self._eng_msg.get_active()
+ checked = self.engchk.get_active()
self.settings.set_value('english', checked)
self.settings.write()
def local_tag_toggled(self, checkbutton):
local_tag_st = checkbutton.get_active()
- self._eng_msg.set_sensitive(not local_tag_st)
- self._use_msg.set_sensitive(not local_tag_st)
- use_msg_st = self._use_msg.get_active()
- self._commit_message.set_sensitive(not local_tag_st and use_msg_st)
+ self.engchk.set_sensitive(not local_tag_st)
+ self.customchk.set_sensitive(not local_tag_st)
+ use_msg_st = self.customchk.get_active()
+ self.msgentry.set_sensitive(not local_tag_st and use_msg_st)
def msg_toggled(self, checkbutton):
state = checkbutton.get_active()
- self._commit_message.set_sensitive(state)
+ self.msgentry.set_sensitive(state)
if state:
- self._commit_message.grab_focus()
+ self.msgentry.grab_focus()
+
+ def combo_changed(self, combo):
+ self.update_revision()
+ self.update_sensitives(True)
def dialog_response(self, dialog, response_id):
# Add button
if response_id == RESPONSE_ADD:
- self._do_add_tag()
+ self.add_tag()
# Remove button
elif response_id == RESPONSE_REMOVE:
- self._do_remove_tag()
+ self.remove_tag()
# Close button or closed by the user
elif response_id in (gtk.RESPONSE_CLOSE, gtk.RESPONSE_DELETE_EVENT):
self.store_settings()
@@ -154,15 +203,15 @@
self.run() # don't close dialog
- def _do_add_tag(self):
+ def add_tag(self):
# gather input data
- is_local = self._local_tag.get_active()
+ is_local = self.localchk.get_active()
name = self.tagentry.get_text()
- rev = self._rev_input.get_text()
- force = self._replace_tag.get_active()
- eng_msg = self._eng_msg.get_active()
- use_msg = self._use_msg.get_active()
- message = self._commit_message.get_text()
+ rev = self.reventry.get_text()
+ force = self.replacechk.get_active()
+ eng_msg = self.engchk.get_active()
+ use_msg = self.customchk.get_active()
+ message = self.msgentry.get_text()
# verify input
if name == '':
@@ -173,16 +222,16 @@ if use_msg and not message:
dialog.error_dialog(self, _('Custom commit message is empty'),
_('Please enter commit message'))
- self._commit_message.grab_focus()
+ self.msgentry.grab_focus()
return False
# add tag to repo
try:
- self._add_hg_tag(name, rev, message, is_local, force=force,
+ self.add_hg_tag(name, rev, message, is_local, force=force,
english=eng_msg)
dialog.info_dialog(self, _('Tagging completed'),
_('Tag "%s" has been added') % name)
- self._refresh()
+ self.update_tagcombo()
except util.Abort, inst:
dialog.error_dialog(self, _('Error in tagging'), str(inst))
return False
@@ -191,12 +240,12 @@ traceback.format_exc())
return False
- def _do_remove_tag(self):
+ def remove_tag(self):
# gather input data
- is_local = self._local_tag.get_active()
+ is_local = self.localchk.get_active()
name = self.tagentry.get_text()
- eng_msg = self._eng_msg.get_active()
- use_msg = self._use_msg.get_active()
+ eng_msg = self.engchk.get_active()
+ use_msg = self.customchk.get_active()
# verify input
if name == '':
@@ -206,15 +255,15 @@ return False
if use_msg:
- message = self._commit_message.get_text()
+ message = self.msgentry.get_text()
else:
message = ''
try:
- self._remove_hg_tag(name, message, is_local, english=eng_msg)
+ self.remove_hg_tag(name, message, is_local, english=eng_msg)
dialog.info_dialog(self, _('Tagging completed'),
_('Tag "%s" has been removed') % name)
- self._refresh()
+ self.update_tagcombo()
except util.Abort, inst:
dialog.error_dialog(self, _('Error in tagging'), str(inst))
return False
@@ -223,8 +272,7 @@ traceback.format_exc())
return False
-
- def _add_hg_tag(self, name, revision, message, local, user=None,
+ def add_hg_tag(self, name, revision, message, local, user=None,
date=None, force=False, english=False):
if hglib.fromutf(name) in self.repo.tags() and not force:
raise util.Abort(_('a tag named "%s" already exists') % name)
@@ -242,7 +290,7 @@ lname = hglib.fromutf(name)
self.repo.tag(lname, r, hglib.fromutf(message), local, user, date)
- def _remove_hg_tag(self, name, message, local, user=None, date=None,
+ def remove_hg_tag(self, name, message, local, user=None, date=None,
english=False):
if hglib.fromutf(name) not in self.repo.tags():
raise util.Abort(_("Tag '%s' does not exist") % name)
|
Loading...