comparison hgext/extdiff.py @ 7990:cdb848e8c4b5

extdiff: word-wrap help texts at 70 characters
author Martin Geisler <mg@daimi.au.dk>
date Sat, 04 Apr 2009 23:17:12 +0200
parents 7b813bdbd5d0
children 683d8ebcf434
comparison
equal deleted inserted replaced
7989:468ab22785aa 7990:cdb848e8c4b5
32 32
33 # add new command called meld, runs meld (no need to name twice) 33 # add new command called meld, runs meld (no need to name twice)
34 meld = 34 meld =
35 35
36 # add new command called vimdiff, runs gvimdiff with DirDiff plugin 36 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
37 #(see http://www.vim.org/scripts/script.php?script_id=102) 37 # (see http://www.vim.org/scripts/script.php?script_id=102)
38 # Non english user, be sure to put "let g:DirDiffDynamicDiffText = 1" in 38 # Non english user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
39 # your .vimrc 39 # your .vimrc
40 vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)' 40 vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)'
41 41
42 You can use -I/-X and list of file or directory names like normal 42 You can use -I/-X and list of file or directory names like normal "hg
43 "hg diff" command. The `extdiff' extension makes snapshots of only 43 diff" command. The `extdiff' extension makes snapshots of only needed
44 needed files, so running the external diff program will actually be 44 files, so running the external diff program will actually be pretty
45 pretty fast (at least faster than having to compare the entire tree). 45 fast (at least faster than having to compare the entire tree).
46 ''' 46 '''
47 47
48 from mercurial.i18n import _ 48 from mercurial.i18n import _
49 from mercurial.node import short 49 from mercurial.node import short
50 from mercurial import cmdutil, util, commands 50 from mercurial import cmdutil, util, commands
192 192
193 Show differences between revisions for the specified files, using 193 Show differences between revisions for the specified files, using
194 an external program. The default program used is diff, with 194 an external program. The default program used is diff, with
195 default options "-Npru". 195 default options "-Npru".
196 196
197 To select a different program, use the -p option. The program 197 To select a different program, use the -p option. The program will
198 will be passed the names of two directories to compare. To pass 198 be passed the names of two directories to compare. To pass
199 additional options to the program, use the -o option. These will 199 additional options to the program, use the -o option. These will
200 be passed before the names of the directories to compare. 200 be passed before the names of the directories to compare.
201 201
202 When two revision arguments are given, then changes are 202 When two revision arguments are given, then changes are shown
203 shown between those revisions. If only one revision is 203 between those revisions. If only one revision is specified then
204 specified then that revision is compared to the working 204 that revision is compared to the working directory, and, when no
205 directory, and, when no revisions are specified, the 205 revisions are specified, the working directory files are compared
206 working directory files are compared to its parent.''' 206 to its parent.'''
207 program = opts['program'] or 'diff' 207 program = opts['program'] or 'diff'
208 if opts['program']: 208 if opts['program']:
209 option = opts['option'] 209 option = opts['option']
210 else: 210 else:
211 option = opts['option'] or ['-Npru'] 211 option = opts['option'] or ['-Npru']