PageRenderTime 35ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/doc/source/common.txt

https://bitbucket.org/tortoisehg/hgtk/
Plain Text | 136 lines | 106 code | 30 blank | 0 comment | 0 complexity | a51d54d0209e128f5ba59adc9629fd27 MD5 | raw file
Possible License(s): GPL-2.0
  1. Common Features
  2. ===============
  3. .. module:: common.dialog
  4. :synopsis: Features common to many dialogs
  5. These features are common to many TortoiseHg tools, so we document them
  6. here just once.
  7. Visual Diffs
  8. ------------
  9. .. figure:: figures/visual-diff.jpg
  10. :alt: Visual Diff Window
  11. Visual Diff Window
  12. In TortoiseHg 1.0, the visual (external) diff infrastructure was
  13. refactored. The new system uses tool descriptions in
  14. :file:`mergetools.rc` to detect most common diff tools on your computer
  15. (including KDiff3, which ships in our installer) and select the best
  16. available tool.
  17. If the user has selected a merge tool
  18. (:menuselection:`TortoiseHg --> Three-way Merge Tool`), that tool will
  19. also be used to perform visual diffs, bypassing the tool selection
  20. process. However the user can still select a separate tool
  21. (:menuselection:`TortoiseHg --> Visual Diff Tool`) for visual diffs if
  22. they chose.
  23. The merge tool configuration file contains optimal command lines for
  24. each tool, so no further configuration is required by the user. They
  25. only need to select the tools they wish use, or accept the defaults.
  26. The visual diff system will use any existing extdiff configuration it
  27. finds. Since extdiff did not support three way diff arguments until
  28. very recently and still does not support label arguments, you will
  29. likely have a better experience by disabling or deleting any extdiff
  30. configuration you may have.
  31. The visual diff system will directly use the selected diff tool unless
  32. the action you are attempting requires the use of the TortoiseHg visual
  33. diff window. The list of conditions includes:
  34. 1) The selection of files being compared require multiple tools
  35. 2) The selected tool forks detached background processes
  36. 3) The selected tool does not support the required directory diffs
  37. 4) The selected tool does not support three way comparisons
  38. 5) The file changes include renames or copies
  39. When the visual diff window is used, the temporary files are cleaned up
  40. when the dialog is closed. Thus it should be left open until you close
  41. all of your diff tool instances. When your diff tool is launched
  42. directly, the temporary files are deleted when your tool exits.
  43. If your diff tool is launched directly to compare a working copy file,
  44. it will directly diff against the working file so you may modify it from
  45. within the diff tool. If you are comparing multiple files, the visual
  46. diff system will make a snapshot of the working copy files and track
  47. their initial sizes and timestamps. When your diff tool exits, the
  48. system compares the sizes and timestamps and copies modified files back
  49. over the original working copies. In this way, you can still modify
  50. your working copy files from your visual diff tool even when performing
  51. directory comparisons.
  52. When the visual diff window is used to compare working copy files, it
  53. always directly diffs against the working copy files since it always
  54. operates on a single file at a time.
  55. .. note::
  56. The :menuselection:`TortoiseHg --> Skip Diff Window` configurable
  57. has been removed because it is now redundant.
  58. Adding Tools
  59. ~~~~~~~~~~~~
  60. If you have a visual diff tool installed that is not supported by
  61. TortoiseHg, you can create a tool configuration for it in your user
  62. :file:`Mercurial.ini` file. See Mercurial's
  63. `documentation <http://www.selenic.com/mercurial/hgrc.5.html#merge-tools>`_
  64. on how to configure your tool for use in file merges. When that is
  65. complete, you can add the extra keys used by TortoiseHg for visual
  66. diff::
  67. diffargs: the arguments to use for two-way file comparisons
  68. diff3args: the arguments to use for three-way file comparisons
  69. dirdiff: this tool supports two-way directory comparisons
  70. dir3diff: this tool supports three-way directory comparisons
  71. When building command line arguments, you can use the following
  72. variables::
  73. $parent1: the file or directory from the first parent revision
  74. $parent2: the file or directory from the second parent revision
  75. $child: the file or directory from the revision being compared
  76. $ancestor: the file or directory from the ancestor of a merge
  77. $parent: a synonym for $parent1
  78. $plabel1: a symbolic name for the first parent revision
  79. $plabel2: a symbolic name for the second parent revision
  80. $clabel: a symbolic name for the revision being compared
  81. $alabel: a symbolic name for the ancestor revision
  82. Obviously, $parent2 and $ancestor are only meaningful when used in three
  83. way diff arguments, for viewing merge changesets. If your diff tool
  84. cannot use the ancestor revision in any productive way, it is safe to
  85. leave it out of the diff3args command line.
  86. .. note::
  87. On Windows, the `executable` parameter can use environment variables
  88. using the syntax ${ProgramFiles}
  89. If unconfigured, the default value of **diffargs** is '$parent $child'.
  90. The default value of **diff3args** is "", indicating the visual diff
  91. tool cannot perform three way comparisons.
  92. If you create a new visual diff tool configuration, or improve upon an
  93. existing configuration, please email it to our development mailing list
  94. so it may be incorporated in a future release.
  95. Word Diffs
  96. ~~~~~~~~~~
  97. The TortoiseHg Windows installers now include TortoiseSVN's scripts for
  98. comparing (and sometimes merging) many binary document formats. These
  99. are configured in the site-wide :file:`mergepatterns.rc` as handlers for
  100. each binary format's common file extensions, so no user intervention is
  101. required.
  102. In order to support file extension based tool selection, TortoiseHg has
  103. added support for a **[diff-patterns]** section equivalent to Mercurial's
  104. `merge-patterns <http://www.selenic.com/mercurial/hgrc.5.html#merge-patterns>`_
  105. section.
  106. .. vim: noet ts=4