Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

merge with Steve Borho

Changeset 1c9faadf11e3

Parents da7d19e195ce

Parents a1c36aaeb933

by Adrian Buehlmann

Changes to 194 files · Browse files at 1c9faadf11e3 Showing diff from parent da7d19e195ce a1c36aaeb933 Diff from another changeset...

Change 1 of 1 Show Entire File .hgignore Stacked
 
3
4
5
6
 
 
7
8
9
10
11
 
12
13
14
 
3
4
5
 
6
7
8
9
10
11
12
13
14
15
16
@@ -3,12 +3,14 @@
 *.orig  *.rej  *.pyc -hggtk/__version__.py +thgutil/__version__.py +thgutil/__paths__.py  build/  dist/  Output/  .*.swp  Thumbs.db +MANIFEST  *.o  *.dll  *.exe
Change 1 of 1 Show Entire File .hgtags Stacked
 
17
18
19
 
 
 
17
18
19
20
21
@@ -17,3 +17,5 @@
 a4a7861b92459c4049d09064707d96e54662e506 0.7.1  39d55a62a43e01e3382fe29319cd9ff7ce7626b2 0.7.2  5215e780e9163cd7f2ce377692d7e719a6e82520 0.7.3 +ef5ab6bccf5ee5356a0d5f42987f55af0f75330f 0.7.4 +a88261eec1f43d37786bfdb492322bddd94dcf8d 0.7.5
Change 1 of 1 Show Entire File MANIFEST.in Stacked
 
 
 
 
 
 
1
2
3
4
@@ -0,0 +1,4 @@
+recursive-include icons *.png *.ico *.svg +include contrib/_hgtk +include contrib/nautilus-thg.py +include COPYING.txt ReleaseNotes.txt
Change 1 of 1 Show Entire File contrib/​_hgtk Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
@@ -0,0 +1,552 @@
+#compdef hgtk + +# Zsh completion script for hgtk. +# copy it into your zsh function path (/usr/share/zsh/site-functions) +# +# Copyright (C) 2009 Steve Borho +# +# This is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your +# option) any later version. + +emulate -LR zsh +setopt extendedglob + +local curcontext="$curcontext" state line +typeset -A _hg_cmd_globals + +_hgtk() { + local cmd _hg_root + integer i=2 + _hg_cmd_globals=() + + while (( i < $#words )) + do + case "$words[$i]" in + -R|--repository) + eval _hg_root="$words[$i+1]" + _hg_cmd_globals+=("$words[$i]" "$_hg_root") + (( i += 2 )) + continue + ;; + -R*) + _hg_cmd_globals+="$words[$i]" + eval _hg_root="${words[$i]#-R}" + (( i++ )) + continue + ;; + --cwd|--config) + # pass along arguments to hg completer + _hg_cmd_globals+=("$words[$i]" "$words[$i+1]") + (( i += 2 )) + continue + ;; + -*) + # skip option + (( i++ )) + continue + ;; + esac + if [[ -z "$cmd" ]] + then + cmd="$words[$i]" + words[$i]=() + (( CURRENT-- )) + fi + (( i++ )) + done + + if [[ -z "$cmd" ]] + then + _arguments -s -w : $_hg_global_opts \ + ':hgtk command:_hg_commands' + return + fi + + # resolve abbreviations and aliases + if ! (( $+functions[_hg_cmd_${cmd}] )) + then + local cmdexp + (( $#_hg_cmd_list )) || _hg_get_commands + + cmdexp=$_hg_cmd_list[(r)${cmd}*] + if [[ $cmdexp == $_hg_cmd_list[(R)${cmd}*] ]] + then + # might be nice to rewrite the command line with the expansion + cmd="$cmdexp" + fi + if [[ -n $_hg_alias_list[$cmd] ]] + then + cmd=$_hg_alias_list[$cmd] + fi + fi + + curcontext="${curcontext%:*:*}:hg-${cmd}:" + + zstyle -s ":completion:$curcontext:" cache-policy update_policy + + if [[ -z "$update_policy" ]] + then + zstyle ":completion:$curcontext:" cache-policy _hg_cache_policy + fi + + if (( $+functions[_hg_cmd_${cmd}] )) + then + _hg_cmd_${cmd} + else + # complete unknown commands normally + _arguments -s -w : $_hg_global_opts \ + '*:files:_hg_files' + fi +} + +_hg_cache_policy() { + typeset -a old + + # cache for a minute + old=( "$1"(mm+10) ) + (( $#old )) && return 0 + + return 1 +} + +_hg_get_commands() { + typeset -ga _hg_cmd_list + typeset -gA _hg_alias_list + local hline cmd cmdalias + + _call_program hgtk hgtk debugcomplete -v 2>/dev/null | while read -A hline + do + cmd=$hline[1] + _hg_cmd_list+=($cmd) + + for cmdalias in $hline[2,-1] + do + _hg_cmd_list+=($cmdalias) + _hg_alias_list+=($cmdalias $cmd) + done + done +} + +_hg_commands() { + (( $#_hg_cmd_list )) || _hg_get_commands + _describe -t commands 'hgtk command' _hg_cmd_list +} + +_hg_revrange() { + compset -P 1 '*:' + _hg_tags "$@" +} + +_hg_tags() { + typeset -a tags + local tag rev + + _hg_cmd tags 2> /dev/null | while read tag + do + tags+=(${tag/ # [0-9]#:*}) + done + (( $#tags )) && _describe -t tags 'tags' tags +} + +_hg_files() { + if [[ -n "$_hg_root" ]] + then + [[ -d "$_hg_root/.hg" ]] || return + case "$_hg_root" in + /*) + _files -W $_hg_root + ;; + *) + _files -W $PWD/$_hg_root + ;; + esac + else + _files + fi +} + +_hg_status() { + [[ -d $PREFIX ]] || PREFIX=$PREFIX:h + status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX 2>/dev/null)"}) +} + +_hg_unknown() { + typeset -a status_files + _hg_status u + _wanted files expl 'unknown files' _multi_parts / status_files +} + +_hg_missing() { + typeset -a status_files + _hg_status d + _wanted files expl 'missing files' _multi_parts / status_files +} + +_hg_modified() { + typeset -a status_files + _hg_status m + _wanted files expl 'modified files' _multi_parts / status_files +} + +_hg_resolve() { + local rstate rpah + + [[ -d $PREFIX ]] || PREFIX=$PREFIX:h + + _hg_cmd resolve -l ./$PREFIX 2> /dev/null | while read rstate rpath + do + [[ $rstate == 'R' ]] && resolved_files+=($rpath) + [[ $rstate == 'U' ]] && unresolved_files+=($rpath) + done +} + +_hg_resolved() { + typeset -a resolved_files unresolved_files + _hg_resolve + _wanted files expl 'resolved files' _multi_parts / resolved_files +} + +_hg_unresolved() { + typeset -a resolved_files unresolved_files + _hg_resolve + _wanted files expl 'unresolved files' _multi_parts / unresolved_files +} + +_hg_config() { + typeset -a items + items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*}) + (( $#items )) && _describe -t config 'config item' items +} + +_hg_addremove() { + _alternative 'files:unknown files:_hg_unknown' \ + 'files:missing files:_hg_missing' +} + +_hg_ssh_urls() { + if [[ -prefix */ ]] + then + if zstyle -T ":completion:${curcontext}:files" remote-access + then + local host=${PREFIX%%/*} + typeset -a remdirs + compset -p $(( $#host + 1 )) + local rempath=${(M)PREFIX##*/} + local cacheid="hg:${host}-${rempath//\//_}" + cacheid=${cacheid%[-_]} + compset -P '*/' + if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" + then + remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}" 2> /dev/null)"}##*/}%/}) + _store_cache "$cacheid" remdirs + fi + _describe -t directories 'remote directory' remdirs -S/ + else + _message 'remote directory' + fi + else + if compset -P '*@' + then + _hosts -S/ + else + _alternative 'hosts:remote host name:_hosts -S/' \ + 'users:user:_users -S@' + fi + fi +} + +_hg_urls() { + if compset -P bundle:// + then + _files + elif compset -P ssh:// + then + _hg_ssh_urls + elif [[ -prefix *: ]] + then + _urls + else + local expl + compset -S '[^:]*' + _wanted url-schemas expl 'URL schema' compadd -S '' - \ + http:// https:// ssh:// bundle:// + fi +} + +_hg_paths() { + typeset -a paths pnames + _hg_cmd paths 2> /dev/null | while read -A pnames + do + paths+=($pnames[1]) + done + (( $#paths )) && _describe -t path-aliases 'repository alias' paths +} + +_hg_remote() { + _alternative 'path-aliases:repository alias:_hg_paths' \ + 'directories:directory:_files -/' \ + 'urls:URL:_hg_urls' +} + +_hg_clone_dest() { + _alternative 'directories:directory:_files -/' \ + 'urls:URL:_hg_urls' +} + +# Common options +_hg_global_opts=( + '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' + '(--verbose -v)'{-v,--verbose}'[enable additional output]' + '(--quiet -q)'{-q,--quiet}'[suppress output]' + '(--help -h)'{-h,--help}'[display help and exit]' + '--debugger[start debugger]' +) + +_hg_pat_opts=( + '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/' + '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') + +_hg_diff_opts=( + '(--text -a)'{-a,--text}'[treat all files as text]' + '(--git -g)'{-g,--git}'[use git extended diff format]' + "--nodates[don't include dates in diff headers]") + +_hg_style_opts=( + '--style[display using template map file]:' + '--template[display with template]:') + +_hg_commit_opts=( + '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]' + '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use <text> as commit message]:message:' + '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files') + +_hg_remote_opts=( + '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:' + '--remotecmd[specify hg command to run on the remote side]:') + +_hg_cmd() { + _call_program hg hg "$_hg_cmd_globals[@]" "$@" +} + +_hg_cmd_add() { + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + '*:unknown files:_hg_unknown' +} + +_hg_cmd_annotate() { + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + '(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_tags' \ + '(--follow -f)'{-f,--follow}'[follow file copies and renames]' \ + '(--text -a)'{-a,--text}'[treat all files as text]' \ + '(--user -u)'{-u,--user}'[list the author]' \ + '(--date -d)'{-d,--date}'[list the date]' \ + '(--number -n)'{-n,--number}'[list the revision number (default)]' \ + '(--changeset -c)'{-c,--changeset}'[list the changeset]' \ + '*:files:_hg_files' +} + +_hg_cmd_clone() { + _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ + '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \ + '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \ + '--uncompressed[use uncompressed transfer (fast over LAN)]' \ + ':source repository:_hg_remote' \ + ':destination:_hg_clone_dest' +} + +_hg_cmd_commit() { + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \ + '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ + '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' \ + '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ + '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ + '*:file:_hg_files' +} + +_hg_cmd_vdiff() { + typeset -A opt_args + _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \ + '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \ + '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \ + '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' \ + '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \ + '(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]' \ + '*:file:->diff_files' + + if [[ $state == 'diff_files' ]] + then + if [[ -n $opt_args[-r] ]] + then + _hg_files + else + _hg_modified + fi + fi +} + +_hg_cmd_export() { + _arguments -s -w : $_hg_global_opts $_hg_diff_opts \ + '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ + '--switch-parent[diff against the second parent]' \ + '*:revision:_hg_tags' +} + +_hg_cmd_grep() { + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + '(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \ + '--all[print all revisions with matches]' \ + '(--follow -f)'{-f,--follow}'[follow changeset or file history]' \ + '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \ + '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \ + '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \ + '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ + '(--user -u)'{-u,--user}'[print user who committed change]' \ + '1:search pattern:' \ + '*:files:_hg_files' +} + +_hg_cmd_heads() { + _arguments -s -w : $_hg_global_opts $_hg_style_opts \ + '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_tags' +} + +_hg_cmd_help() { + _arguments -s -w : $_hg_global_opts \ + '*:hgtk command:_hg_commands' +} + +_hg_cmd_incoming() { + _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ + '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ + '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ + '(--patch -p)'{-p,--patch}'[show patch]' \ + '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \ + '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ + '--bundle[file to store the bundles into]:bundle file:_files' \ + ':source:_hg_remote' +} + +_hg_cmd_init() { + _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ + ':dir:_files -/' +} + +_hg_cmd_log() { + _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_style_opts \ + '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \ + '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \ + '(--copies -C)'{-C,--copies}'[show copied files]' \ + '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \ + '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ + '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \ + '(--no-merges -M)'{-M,--no-merges}'[do not show merges]' \ + '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \ + '(--patch -p)'{-p,--patch}'[show patch]' \ + '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_tags' \ + '*:files:_hg_files' +} + +_hg_cmd_outgoing() { + _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ + '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ + '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ + '(--patch -p)'{-p,--patch}'[show patch]' \ + '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \ + '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ + ':destination:_hg_remote' +} + +_hg_cmd_pull() { + _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ + '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ + '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \ + '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \ + ':source:_hg_remote' +} + +_hg_cmd_push() { + _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ + '(--force -f)'{-f,--force}'[force push]' \ + '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_tags' \ + ':destination:_hg_remote' +} + +_hg_cmd_remove() { + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + '(--after -A)'{-A,--after}'[record remove that has already occurred]' \ + '(--force -f)'{-f,--force}'[remove file even if modified]' \ + '*:file:_hg_files' +} + +_hg_cmd_rename() { + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + '(--after -A)'{-A,--after}'[record a rename that has already occurred]' \ + '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ + '*:file:_hg_files' +} + +_hg_cmd_revert() { + local context state line + typeset -A opt_args + + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \ + '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_tags' \ + '--no-backup[do not save backup copies of files]' \ + '*:file:->diff_files' + + if [[ $state == 'diff_files' ]] + then + if [[ -n $opt_args[-r] ]] + then + _hg_files + else + typeset -a status_files + _hg_status mard + _wanted files expl 'modified, added, removed or deleted file' _multi_parts / status_files + fi + fi +} + +_hg_cmd_serve() { + _arguments -s -w : $_hg_global_opts \ + '(--accesslog -A)'{-A+,--accesslog}'[name of access log file]:log file:_files' \ + '(--errorlog -E)'{-E+,--errorlog}'[name of error log file]:log file:_files' \ + '(--daemon -d)'{-d,--daemon}'[run server in background]' \ + '(--port -p)'{-p+,--port}'[listen port]:listen port:' \ + '(--address -a)'{-a+,--address}'[interface address]:interface address:' \ + '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \ + '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \ + '--style[web template style]:style' \ + '--stdio[for remote clients]' \ + '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]' +} + +_hg_cmd_status() { + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + '(--all -A)'{-A,--all}'[show status of all files]' \ + '(--modified -m)'{-m,--modified}'[show only modified files]' \ + '(--added -a)'{-a,--added}'[show only added files]' \ + '(--removed -r)'{-r,--removed}'[show only removed files]' \ + '(--deleted -d)'{-d,--deleted}'[show only deleted (but tracked) files]' \ + '(--clean -c)'{-c,--clean}'[show only files without changes]' \ + '(--unknown -u)'{-u,--unknown}'[show only unknown files]' \ + '(--ignored -i)'{-i,--ignored}'[show ignored files]' \ + '(--no-status -n)'{-n,--no-status}'[hide status prefix]' \ + '(--copies -C)'{-C,--copies}'[show source of copied files]' \ + '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ + '--rev[show difference from revision]:revision:_hg_tags' \ + '*:files:_files' +} + +_hg_cmd_update() { + _arguments -s -w : $_hg_global_opts \ + '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ + '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ + ':revision:_hg_tags' +} + +_hgtk "$@"
Change 1 of 1 Show Entire File contrib/​hg Stacked
 
8
9
10
11
 
 
 
 
 
 
 
 
12
 
 
13
 
 
 
 
14
 
8
9
10
 
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@@ -8,7 +8,20 @@
 # of the GNU General Public License, incorporated herein by reference.    # enable importing on demand to reduce startup time -from mercurial import demandimport; demandimport.enable() +try: + from mercurial import demandimport; demandimport.enable() +except ImportError: + import sys + sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" % + ' '.join(sys.path)) + sys.stderr.write("(check your install and PYTHONPATH)\n") + sys.exit(-1)   +import sys +import mercurial.util  import mercurial.dispatch + +for fp in (sys.stdin, sys.stdout, sys.stderr): + mercurial.util.set_binary(fp) +  mercurial.dispatch.run()
 
1
 
2
3
 
4
5
6
 
9
10
11
12
13
14
15
16
17
 
 
 
 
 
 
 
 
 
 
 
18
19
20
21
22
23
24
 
25
26
27
28
 
29
30
31
 
 
 
32
33
34
 
38
39
40
41
42
43
44
45
46
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
49
50
 
 
51
52
53
 
54
55
56
57
58
59
60
61
62
63
 
72
73
74
 
75
76
77
78
79
80
 
81
82
83
 
 
 
84
85
86
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
89
90
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
 
 
 
 
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
 
 
 
431
432
433
 
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
 
 
 
 
 
 
 
 
 
 
 
467
468
 
 
 
 
 
469
470
471
472
473
474
475
476
477
478
479
 
 
 
 
 
 
 
 
 
480
481
482
 
 
 
483
484
485
 
486
487
488
489
 
490
491
492
493
494
495
496
 
497
498
499
 
505
506
507
508
509
510
 
511
512
513
 
514
515
516
 
528
529
530
531
532
533
534
 
 
 
 
535
536
537
538
539
540
 
 
 
 
 
541
542
 
543
544
 
545
546
547
 
548
549
 
 
 
1
2
 
3
4
5
6
 
9
10
11
 
12
13
 
 
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
 
29
30
31
32
33
34
35
36
37
 
 
38
39
40
41
42
43
 
47
48
49
 
 
 
 
 
 
 
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 
80
81
82
83
 
84
85
86
87
 
 
 
 
88
89
90
 
99
100
101
102
103
104
105
106
107
 
108
109
110
111
112
113
114
115
 
 
 
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
 
 
 
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
221
222
223
224
225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
227
228
229
230
231
 
234
235
236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
 
 
 
 
 
 
 
 
 
 
256
257
258
259
260
261
262
263
264
265
 
 
266
267
268
269
270
 
271
272
273
274
 
275
276
277
278
279
280
281
 
282
283
284
285
 
291
292
293
 
294
 
295
296
297
 
298
299
300
301
 
313
314
315
 
 
 
 
316
317
318
319
320
 
 
 
 
 
321
322
323
324
325
326
 
327
328
 
329
330
 
 
331
332
 
333
@@ -1,6 +1,6 @@
-# Trivial Mercurial plugin for Nautilus +# TortoiseHg plugin for Nautilus  # -# Copyright (C) 2007 Steve Borho +# Copyright (C) 2007-9 Steve Borho  #  # Stolen mercilessly from nautilus-bzr, thanks guys  # Copyright (C) 2006 Jeff Bailey @@ -9,26 +9,35 @@
 #  # Published under the GNU GPL   -import gconf  import gtk  import gobject -from mercurial import hg, ui, match, util -from mercurial.node import short  import nautilus + +try: + from mercurial import demandimport +except ImportError: + # workaround to use user's local python libs + userlib = os.path.expanduser('~/lib/python') + if os.path.exists(userlib) and userlib not in sys.path: + sys.path.append(userlib) + from mercurial import demandimport +demandimport.enable() +  import os  import subprocess  import sys -import tempfile -import time  import urllib   +from mercurial import hg, ui, match, util  try:   from mercurial.error import RepoError  except ImportError:   from mercurial.repo import RepoError +from mercurial.node import short   -TORTOISEHG_PATH = '~/tools/tortoisehg-dev' -TERMINAL_KEY = '/desktop/gnome/applications/terminal/exec' +nofilecmds = 'about serve synch repoconfig userconfig merge unmerge'.split() +nocachecmds = 'about serve repoconfig userconfig'.split() +    class HgExtension(nautilus.MenuProvider,   nautilus.ColumnProvider, @@ -38,26 +47,44 @@
  def __init__(self):   self.cacherepo = None   self.cacheroot = None - self.client = gconf.client_get_default() - thgpath = os.environ.get('TORTOISEHG_PATH', - os.path.expanduser(TORTOISEHG_PATH)) - os.environ['TORTOISEHG_PATH'] = thgpath - os.environ['THG_ICON_PATH'] = os.path.join(thgpath, 'icons') - self.hgproc = os.path.join(thgpath, 'hgproc.py') - self.ipath = os.path.join(thgpath, 'icons', 'tortoise') + self.scanStack = [] + + # check if nautilus-thg.py is a symlink first + pfile = __file__ + if pfile.endswith('.pyc'): + pfile = pfile[:-1] + path = os.path.dirname(os.path.realpath(pfile)) + thgpath = os.path.normpath(os.path.join(path, '..')) + testpath = os.path.join(thgpath, 'tortoise') + if os.path.isdir(testpath): + if thgpath not in sys.path: + sys.path.insert(0, thgpath) + # else assume thgutil is already in PYTHONPATH + try: + from thgutil import paths, debugthg, menuthg + except ImportError, e: + print e + self.menu = None + return + + self.hgtk = paths.find_in_path('hgtk') + self.menu = menuthg.menuThg() + + global debugf + if debugthg.debug('N'): + debugf = debugthg.debugf + else: + debugf = debugthg.debugf_No     def icon(self, iname): - return os.path.join(self.ipath, iname) + from thgutil import paths + return paths.get_tortoise_icon(iname)     def get_path_for_vfs_file(self, vfs_file): - if vfs_file.get_uri_scheme() != 'file': + if vfs_file.is_gone() or vfs_file.get_uri_scheme() != 'file':   return None   return urllib.unquote(vfs_file.get_uri()[7:])   - def clear_cached_repo(self): - self.cacheroot = None - self.cacherepo = None -   def get_repo_for_path(self, path):   '''   Find mercurial repository for vfs_file @@ -72,362 +99,133 @@
    if p == self.cacheroot:   return self.cacherepo + from thgutil import hglib   # Keep one repo cached   try:   self.cacheroot = p   self.cacherepo = hg.repository(ui.ui(), path=p)   return self.cacherepo - except RepoError: + except hglib.RepoError:   self.cacheroot = None   self.cacherepo = None   return None + except StandardError, e: + debugf(e) + return None   - def _open_terminal_cb(self, window, vfs_file): - path = self.get_path_for_vfs_file(vfs_file) - if path is None: + def run_dialog(self, menuitem, hgtkcmd, cwd = None): + ''' + hgtkcmd - hgtk subcommand + ''' + if cwd: #bg + self.files = [] + else: + cwd = self.cwd + repo = self.get_repo_for_path(cwd) + + cmdopts = [sys.executable, self.hgtk, hgtkcmd] + + if hgtkcmd not in nofilecmds and self.files: + pipe = subprocess.PIPE + cmdopts += ['--listfile', '-'] + else: + pipe = None + + proc = subprocess.Popen(cmdopts, cwd=cwd, stdin=pipe, shell=False) + if pipe: + proc.stdin.write('\n'.join(self.files)) + proc.stdin.close() + + if hgtkcmd not in nocachecmds: + # Remove cached repo object, dirstate may change + self.cacherepo = None + self.cacheroot = None + + def buildMenu(self, vfs_files, bg): + '''Build menu''' + self.pos = 0 + self.files = [] + files = [] + for vfs_file in vfs_files: + f = self.get_path_for_vfs_file(vfs_file) + if f: + files.append(f) + if not files:   return - os.chdir(path) - terminal = self.client.get_string(TERMINAL_KEY) - os.system('%s &' % terminal) + if bg or len(files) == 1 and vfs_files[0].is_directory(): + cwd = files[0] + files = [] + else: + cwd = os.path.dirname(files[0]) + repo = self.get_repo_for_path(cwd) + if repo: + menus = self.menu.get_commands(repo, cwd, files) + if cwd == repo.root: + cwd_rel = '' + else: + cwd_rel = cwd[len(repo.root+os.sep):] + os.sep + for f in files: + try: + cpath = util.canonpath(repo.root, cwd, f) + if cpath.startswith(cwd_rel): + cpath = cpath[len(cwd_rel):] + self.files.append(cpath) + else: + self.files.append(f) + except util.Abort: # canonpath will abort on .hg/ paths + pass + else: + menus = self.menu.get_norepo_commands(cwd, files) + self.cwd = cwd + return self._buildMenu(menus)   - def _about_cb(self, window, vfs_file): - self._run_dialog('about', [vfs_file]) - - def _add_cb(self, window, vfs_files): - self._run_dialog('add', vfs_files) - self.clear_cached_repo() - - def _clone_cb(self, window, vfs_file): - self._run_dialog('clone', [vfs_file]) - - def _commit_cb(self, window, vfs_files): - self._run_dialog('commit', vfs_files) - self.clear_cached_repo() - - def _datamine_cb(self, window, vfs_files): - self._run_dialog('datamine', vfs_files) - - def _diff_cb(self, window, vfs_files): - path = self.get_path_for_vfs_file(vfs_files[0]) - if path is None: - return - repo = self.get_repo_for_path(path) - if repo is None: - return - diffcmd = repo.ui.config('tortoisehg', 'vdiff', 'vdiff') - if not diffcmd: - self._run_dialog('diff', vfs_files) - else: - cmdline = ['hg', diffcmd] - cwd = os.path.isdir(path) and path or os.path.dirname(path) - paths = [self.get_path_for_vfs_file(f) for f in vfs_files] - subprocess.Popen(cmdline + paths, shell=False, cwd=cwd) - - def _history_cb(self, window, vfs_files): - self._run_dialog('history', vfs_files) - self.clear_cached_repo() - - def _init_cb(self, window, vfs_file): - self._run_dialog('init', [vfs_file]) - - def _recovery_cb(self, window, vfs_file): - self._run_dialog('recovery', [vfs_file]) - self.clear_cached_repo() - - def _revert_cb(self, window, vfs_files): - self._run_dialog('revert', vfs_files) - self.clear_cached_repo() - - def _serve_cb(self, window, vfs_file): - self._run_dialog('serve', [vfs_file], filelist=False) - - def _status_cb(self, window, vfs_file): - self._run_dialog('status', [vfs_file]) - - def _sync_cb(self, window, vfs_file): - self._run_dialog('synch', [vfs_file], filelist=False) - self.clear_cached_repo() - - def _thgconfig_repo_cb(self, window, vfs_file): - self._run_dialog('config', [vfs_file]) - - def _thgconfig_user_cb(self, window, vfs_file): - self._run_dialog('config', [vfs_file], filelist=False) - - def _unmerge_cb(self, window, vfs_file): - self._run_dialog('checkout', [vfs_file], filelist=False, - extras=['--', '--clean', str(self.rev0)]) - self.clear_cached_repo() - - def _run_dialog(self, hgcmd, vfs_files, filelist=True, extras=[]): - ''' - hgcmd - hgproc subcommand - vfs_files - directory, or list of selected files - filelist - bool for whether to generate file list for hgproc - ''' - paths = [self.get_path_for_vfs_file(f) for f in vfs_files] - if paths[0] is None: - return - - path = paths[0] - repo = self.get_repo_for_path(path) - cwd = os.path.isdir(path) and path or os.path.dirname(path) - - if repo is not None: - root = repo.root - else: - root = cwd - - cmdopts = [sys.executable, self.hgproc] - cmdopts += ['--root', root] - cmdopts += ['--cwd', cwd] - cmdopts += ['--command', hgcmd] - - if filelist: - # Use temporary file to store file list (avoid shell command - # line limitations) - fd, tmpfile = tempfile.mkstemp(prefix="tortoisehg_filelist_") - os.write(fd, "\n".join(paths)) - os.close(fd) - cmdopts += ['--listfile', tmpfile, '--deletelistfile'] - cmdopts.extend(extras) - - subprocess.Popen(cmdopts, cwd=cwd, shell=False) - - # Remove cached repo object, dirstate may change - self.cacherepo = None - self.cacheroot = None + def _buildMenu(self, menus): + '''Build one level of a menu''' + items = [] + if self.files: + passcwd = None + else: #bg + passcwd = self.cwd + for menu_info in menus: + idstr = 'HgNautilus::%02d%s' % (self.pos, menu_info.hgcmd) + self.pos += 1 + if menu_info.isSep(): + # can not insert a separator till now + pass + elif menu_info.isSubmenu(): + if hasattr(nautilus, 'Menu'): + item = nautilus.MenuItem(idstr, menu_info.menutext, + menu_info.helptext) + submenu = nautilus.Menu() + item.set_submenu(submenu) + for subitem in self._buildMenu(menu_info.get_menus()): + submenu.append_item(subitem) + items.append(item) + else: #submenu not suported + for subitem in self._buildMenu(menu_info.get_menus()): + items.append(subitem) + else: + if menu_info.state: + item = nautilus.MenuItem(idstr, + menu_info.menutext, + menu_info.helptext, + self.icon(menu_info.icon)) + item.connect('activate', self.run_dialog, menu_info.hgcmd, + passcwd) + items.append(item) + return items     def get_background_items(self, window, vfs_file):   '''Build context menu for current directory''' - mainitem = nautilus.MenuItem('HgNautilus', 'Mercurial', '') - submenu = nautilus.Menu() - mainitem.set_submenu(submenu) - - path = self.get_path_for_vfs_file(vfs_file) - if path is None: - return - - repo = self.get_repo_for_path(path) - if repo is None: - ''' The name given to nautilus.MenuItem decides the - of the menu, which is ordered alpahbetically ''' - item = nautilus.MenuItem('HgNautilus::newtree', - 'Create New Repository', - 'Make directory versioned', - self.icon('menucreaterepos.ico')) - item.connect('activate', self._init_cb, vfs_file) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::clone', - 'Create Clone', - 'Create clone here from source', - self.icon('menuclone.ico')) - item.connect('activate', self._clone_cb, vfs_file) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::99about', - 'About TortoiseHg', - 'Information about TortoiseHg installation', - self.icon('menuabout.ico')) - item.connect('activate', self._about_cb, vfs_file) - submenu.append_item(item) - - return mainitem, - - if len(repo.changectx(None).parents()) > 1: - self.rev0 = repo.changectx(None).parents()[0].rev() - item = nautilus.MenuItem('HgNautilus::undomerge', - 'Undo Merge', - 'Clean checkout of original parent revision', - self.icon('menuunmerge.ico')) - item.connect('activate', self._unmerge_cb, vfs_file) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::10commit', - 'Commit', - 'Commit changes', - self.icon('menucommit.ico')) - item.connect('activate', self._commit_cb, [vfs_file]) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::20status', - 'Show Status', - 'Show Repository Status', - self.icon('menushowchanged.ico')) - item.connect('activate', self._status_cb, vfs_file) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::30diff', - 'Visual Diff', - 'Show Changes to Repository', - self.icon('menudiff.ico')) - item.connect('activate', self._diff_cb, [vfs_file]) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::40dag', - 'Revision History', - 'Show revision DAG', - self.icon('menurevisiongraph.ico')) - item.connect('activate', self._history_cb, [vfs_file]) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::50datamine', - 'Data Mining', - 'Search revision history', - self.icon('menulog.ico')) - item.connect('activate', self._datamine_cb, [vfs_file]) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::60sync', - 'Synchronize', - 'Sync with another repository', - self.icon('menusynch.ico')) - item.connect('activate', self._sync_cb, vfs_file) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::70serve', - 'Web Server', - 'Start internal web server', - self.icon('proxy.ico')) - item.connect('activate', self._serve_cb, vfs_file) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::75recover', - 'Recovery', - 'General repair and recovery of repository', - self.icon('general.ico')) - item.connect('activate', self._recovery_cb, vfs_file) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::80repoconfig', - 'Repository Settings', - 'Configure Mercurial settings for this repo', - self.icon('menusettings.ico')) - item.connect('activate', self._thgconfig_repo_cb, vfs_file) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::85userconfig', - 'User-Global Settings', - 'Configure global Mercurial settings', - self.icon('menusettings.ico')) - item.connect('activate', self._thgconfig_user_cb, vfs_file) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::99about', - 'About TortoiseHg', - 'Information about TortoiseHg installation', - self.icon('menuabout.ico')) - item.connect('activate', self._about_cb, vfs_file) - submenu.append_item(item) - - return mainitem, + if vfs_file and self.menu: + return self.buildMenu([vfs_file], True) + else: + self.files = []     def get_file_items(self, window, vfs_files): - mainitem = nautilus.MenuItem('HgNautilus', 'Mercurial', '') - submenu = nautilus.Menu() - mainitem.set_submenu(submenu) - - '''Build context menu for selected files''' - if not vfs_files: - return None - - vfs_file = vfs_files[0] - path = self.get_path_for_vfs_file(vfs_file) - repo = self.get_repo_for_path(path) - if repo is None: - if not vfs_file.is_directory(): - return None - - # Menu for unrevisioned subdirectory - name = vfs_files[0].get_name() - item = nautilus.MenuItem('HgNautilus::10newtree', - 'Make directory versioned', - 'Create Repository in %s' % name, - self.icon('menucreaterepos.ico')) - item.connect('activate', self._init_cb, vfs_file) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::20clone', - 'Create clone from source', - 'Create Clone in %s' % name, - self.icon('menuclone.ico')) - item.connect('activate', self._clone_cb, vfs_file) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::99about', - 'About TortoiseHg', - 'Information about TortoiseHg installation', - self.icon('menuabout.ico')) - item.connect('activate', self._about_cb, vfs_file) - submenu.append_item(item) - - return mainitem, - - localpaths = [] - for vfs_file in vfs_files: - path = self.get_path_for_vfs_file(vfs_file) - if path is None: - continue - localpath = path[len(repo.root)+1:] - localpaths.append(localpath) - - if not localpaths: - return - path = localpaths[0] - cwd = os.path.isdir(path) and path or os.path.dirname(path) - matcher = match.exact(repo.root, cwd, localpaths) - changes = repo.dirstate.status(matcher, True, True, True) - (lookup, modified, added, removed, deleted, unknown, - ignored, clean) = changes - - # Add menu items based on states list - if unknown: - item = nautilus.MenuItem('HgNautilus::30add', - 'Add Files', - 'Add unversioned files', - self.icon('menuadd.ico')) - item.connect('activate', self._add_cb, vfs_files) - submenu.append_item(item) - - if modified or added or removed or deleted or unknown: - item = nautilus.MenuItem('HgNautilus::40commit', - 'Commit Files', - 'Commit changes', - self.icon('menucommit.ico')) - item.connect('activate', self._commit_cb, vfs_files) - submenu.append_item(item) - - item = nautilus.MenuItem('HgNautilus::50revert', - 'Undo Changes', - 'Revert changes to files', - self.icon('menurevert.ico')) - item.connect('activate', self._revert_cb, vfs_files) - submenu.append_item(item) - - if modified or clean: - item = nautilus.MenuItem('HgNautilus::60log', - 'File Changelog', - 'Show file revision history', - self.icon('menulog.ico')) - item.connect('activate', self._history_cb, vfs_files) - item = nautilus.MenuItem('HgNautilus::annotate', - 'Annotate File', - 'Annotate file at current revision', - self.icon('menulog.ico')) - item.connect('activate', self._datamine_cb, vfs_files) - submenu.append_item(item) - - - if modified: - item = nautilus.MenuItem('HgNautilus::70diff', - 'File Diffs', - 'Show file changes', - self.icon('menudiff.ico')) - item.connect('activate', self._diff_cb, vfs_files) - submenu.append_item(item) - - return mainitem, + '''Build context menu for selected files/directories''' + if vfs_files and self.menu: + return self.buildMenu(vfs_files, False)     def get_columns(self):   return nautilus.Column("HgNautilus::80hg_status", @@ -436,64 +234,52 @@
  "Version control status"),     def _get_file_status(self, repo, localpath): - emblem = None - status = '?' - - # This is not what the API is optimized for, but this appears - # to work efficiently enough - matcher = match.always(repo.root, localpath) - changes = repo.dirstate.status(matcher, True, True, True) - (lookup, modified, added, removed, deleted, unknown, - ignored, clean) = changes - - if localpath in clean: - emblem = 'default' - status = 'clean' - elif localpath in modified: - emblem = 'cvs-modified' - status = 'modified' - elif localpath in added: - emblem = 'cvs-aded' - status = 'added' - elif localpath in unknown: - emblem = 'new' - status = 'unrevisioned' - elif localpath in ignored: - status = 'ignored' - elif localpath in deleted: - # Should be hard to reach this state - emblem = 'stockmail-priority-high' - status = 'deleted' + from thgutil import cachethg + cachestate = cachethg.get_state(localpath, repo) + cache2state = {cachethg.UNCHANGED: ('default', 'clean'), + cachethg.ADDED: ('cvs-added', 'added'), + cachethg.MODIFIED: ('cvs-modified', 'modified'), + cachethg.UNKNOWN: ('new', 'unrevisioned'), + cachethg.IGNORED: (None, 'ignored'), + cachethg.NOT_IN_REPO: (None, ''), + cachethg.ROOT: ('generic', 'root'), + cachethg.UNRESOLVED: ('cvs-confilict', 'unresolved')} + emblem, status = cache2state.get(cachestate, (None, '?'))   return emblem, status   + def update_file_info(self, file): + '''Queue file for emblem and hg status update''' + self.scanStack.append(file) + if len(self.scanStack) == 1: + gobject.idle_add(self.fileinfo_on_idle)   - def update_file_info(self, file): - '''Return emblem and hg status for this file''' - path = self.get_path_for_vfs_file(file) - if path is None or file.is_directory(): - return - repo = self.get_repo_for_path(path) - if repo is None: - return - localpath = path[len(repo.root)+1:] - emblem, status = self._get_file_status(repo, localpath) + def fileinfo_on_idle(self): + '''Update emblem and hg status for files when there is time''' + if not self.scanStack: + return False + vfs_file = self.scanStack.pop() + path = self.get_path_for_vfs_file(vfs_file) + if not path: + return True + emblem, status = self._get_file_status(self.cacherepo, path)   if emblem is not None: - file.add_emblem(emblem) - file.add_string_attribute('hg_status', status) + vfs_file.add_emblem(emblem) + vfs_file.add_string_attribute('hg_status', status) + return True     # property page borrowed from http://www.gnome.org/~gpoo/hg/nautilus-hg/ - def __add_row(self, table, row, label_item, label_value): + def __add_row(self, row, label_item, label_value):   label = gtk.Label(label_item)   label.set_use_markup(True)   label.set_alignment(1, 0) - table.attach(label, 0, 1, row, row + 1, gtk.FILL, gtk.FILL, 0, 0) + self.table.attach(label, 0, 1, row, row + 1, gtk.FILL, gtk.FILL, 0, 0)   label.show()     label = gtk.Label(label_value)   label.set_use_markup(True)   label.set_alignment(0, 1)   label.show() - table.attach(label, 1, 2, row, row + 1, gtk.FILL, 0, 0, 0) + self.table.attach(label, 1, 2, row, row + 1, gtk.FILL, 0, 0, 0)     def get_property_pages(self, vfs_files):   if len(vfs_files) != 1: @@ -505,12 +291,11 @@
  repo = self.get_repo_for_path(path)   if repo is None:   return -   localpath = path[len(repo.root)+1:] - emblem, status = self._get_file_status(repo, localpath) + emblem, status = self._get_file_status(repo, path)     # Get the information from Mercurial - ctx = repo.changectx(None).parents()[0] + ctx = repo['.']   try:   fctx = ctx.filectx(localpath)   rev = fctx.filelog().linkrev(fctx.filerev()) @@ -528,22 +313,21 @@
    self.property_label = gtk.Label('Mercurial')   - table = gtk.Table(7, 2, False) - table.set_border_width(5) - table.set_row_spacings(5) - table.set_col_spacings(5) + self.table = gtk.Table(7, 2, False) + self.table.set_border_width(5) + self.table.set_row_spacings(5) + self.table.set_col_spacings(5)   - self.__add_row(table, 0, '<b>Status</b>:', status) - self.__add_row(table, 1, '<b>Last-Commit-Revision</b>:', str(rev)) - self.__add_row(table, 2, '<b>Last-Commit-Description</b>:', description) - self.__add_row(table, 3, '<b>Last-Commit-Date</b>:', date) - self.__add_row(table, 4, '<b>Last-Commit-User</b>:', user) + self.__add_row(0, '<b>Status</b>:', status) + self.__add_row(1, '<b>Last-Commit-Revision</b>:', str(rev)) + self.__add_row(2, '<b>Last-Commit-Description</b>:', description) + self.__add_row(3, '<b>Last-Commit-Date</b>:', date) + self.__add_row(4, '<b>Last-Commit-User</b>:', user)   if tags: - self.__add_row(table, 5, '<b>Tags</b>:', tags) + self.__add_row(5, '<b>Tags</b>:', tags)   if branch != 'default': - self.__add_row(table, 6, '<b>Branch</b>:', branch) + self.__add_row(6, '<b>Branch</b>:', branch)   - table.show() - + self.table.show()   return nautilus.PropertyPage("MercurialPropertyPage::status", - self.property_label, table), + self.property_label, self.table),
Change 1 of 7 Show Entire File contrib/​tracelog.py Stacked
renamed from tracelog.py
 
26
27
28
29
 
30
31
32
33
34
 
35
36
37
38
39
40
41
42
 
 
43
44
45
 
55
56
57
58
 
59
60
61
 
68
69
70
71
 
72
73
74
 
75
76
77
78
 
79
80
81
 
82
83
84
85
86
87
88
 
89
90
91
 
95
96
97
98
99
 
 
100
101
102
 
109
110
111
112
 
113
114
 
115
116
117
 
120
121
122
123
 
124
125
126
 
132
133
134
135
 
136
137
138
139
 
140
141
142
 
26
27
28
 
29
30
31
32
33
 
34
35
36
37
38
39
40
 
 
41
42
43
44
45
 
55
56
57
 
58
59
60
61
 
68
69
70
 
71
72
73
 
74
75
76
77
 
78
79
80
 
81
82
83
84
85
86
87
 
88
89
90
91
 
95
96
97
 
 
98
99
100
101
102
 
109
110
111
 
112
113
 
114
115
116
117
 
120
121
122
 
123
124
125
126
 
132
133
134
 
135
136
137
138
 
139
140
141
142
@@ -26,20 +26,20 @@
  def __init__(self):   self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)   self.window.set_title("Python Trace Collector") - +   # construct window   self.window.set_default_size(700, 400)   self.main_area = gtk.VBox()   self.window.add(self.main_area) - +   # mimic standard dialog widgets   self.action_area = gtk.HBox()   self.main_area.pack_end(self.action_area, False, False, 5)   sep = gtk.HSeparator()   self.main_area.pack_end(sep, False, False, 0)   self.vbox = gtk.VBox() - self.main_area.pack_end(self.vbox) - + self.main_area.pack_end(self.vbox) +   # add python trace ouput window   scrolledwindow = gtk.ScrolledWindow()   scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) @@ -55,7 +55,7 @@
  # add buttons   self._button_quit = gtk.Button("Quit")   self._button_quit.connect('clicked', self._on_ok_clicked) - self.action_area.pack_end(self._button_quit, False, False, 5) + self.action_area.pack_end(self._button_quit, False, False, 5)     self._button_clear = gtk.Button("Clear")   self._button_clear.connect('clicked', self._on_clear_clicked) @@ -68,24 +68,24 @@
  def _on_ok_clicked(self, button):   self._stop_read_thread()   gtk.main_quit() - +   def _on_clear_clicked(self, button):   self.write("", False) - +   def _on_window_close_clicked(self, event, param):   self._stop_read_thread()   gtk.main_quit() - +   def _on_window_map_event(self, event, param):   self._begin_trace() - +   def _begin_trace(self):   self.queue = Queue.Queue()   win32trace.InitRead()   self.write("Collecting Python Trace Output...\n")   gobject.timeout_add(10, self._process_queue)   self._start_read_thread() - +   def _start_read_thread(self):   self._read_trace = True   self.thread1 = threading.Thread(target=self._do_read_trace) @@ -95,8 +95,8 @@
  self._read_trace = False     # wait for worker thread to to fix Unhandled exception in thread - self.thread1.join() - + self.thread1.join() +   def _process_queue(self):   """   Handle all the messages currently in the queue (if any). @@ -109,9 +109,9 @@
  self.write(ts + line)   except Queue.Empty:   pass - +   return True - +   def _do_read_trace(self):   """   print buffer collected in win32trace @@ -120,7 +120,7 @@
  msg = win32trace.read()   if msg:   self.queue.put(msg) - +   def write(self, msg, append=True):   msg = toutf(msg)   if append: @@ -132,11 +132,11 @@
  def main(self):   self.window.show_all()   gtk.main() - +  def run():   dlg = TraceLog()   dlg.main() - +  if __name__ == "__main__":   run()  
Change 1 of 1 Show Entire File contrib/​win32/​mercurial.ini Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
@@ -0,0 +1,187 @@
+; System-wide Mercurial config file. + +; +; !!! Do Not Edit This File !!! +; +; This file is intended to be replaced by the installer on every upgrade. +; Editing this file can cause strange side effects on Vista. +; +; http://bitbucket.org/tortoisehg/stable/issue/135 +; +; To change settings you see in this file, override (or enable) them in +; your user Mercurial.ini file. See the hgrc man page for details. +; + +[ui] +; editor used to enter commit logs, etc. Most any text editor +; will suffice. +editor = notepad + +; In order to push/pull over ssh you must specify a ssh tool +ssh = "{app}\TortoisePlink.exe" -ssh -2 +;ssh = C:\cygwin\bin\ssh + +[merge-tools] +kdiff3.priority=-1 +kdiff3.args=-L1 base --L2 local --L3 other $base $local $other -o $output +kdiff3.regkey=Software\KDiff3 +kdiff3.regappend=\kdiff3.exe +kdiff3.fixeol=True +kdiff3.gui=True +beyondcompare3.priority=-2 +beyondcompare3.args=$local $other $base $output /ro /lefttitle=local /centertitle=base /righttitle=other /automerge /reviewconflicts /solo +beyondcompare3.regkey=Software\Scooter Software\Beyond Compare 3 +beyondcompare3.regname=ExePath +beyondcompare3.gui=True +diffmerge.priority=-7 +diffmerge.args=--nosplash --merge --title1=base --title2=local --title3=other $base $local $other +diffmerge.checkchanged=True +diffmerge.gui=True +p4merge.priority=-8 +p4merge.args=$base $local $other $output +p4merge.regkey=Software\Perforce\Environment +p4merge.regname=P4INSTROOT +p4merge.regappend=\p4merge.exe +p4merge.gui=True +tortoisemerge.priority=-9 +tortoisemerge.args=/base:$output /mine:$local /theirs:$other /merged:$output +tortoisemerge.regkey=Software\TortoiseSVN +tortoisemerge.gui=True +winmergeu.regkey=Software\Thingamahoochie\WinMerge\ +winmergeu.regname=Executable +winmergeu.priority=-10 +winmergeu.args=/e /ub /dl other /dr local $other $local $output +winmergeu.fixeol=True +winmergeu.gui=True + +; +; For more information about mercurial extensions, start here +; http://www.selenic.com/mercurial/wiki/index.cgi/UsingExtensions +; + +[extensions] +; extensions shipped with Mercurial by default +; +;acl = +;alias = +;bookmarks = +;bugzilla = +;children = +;churn = +; Warning: the color extension is not recommended for Windows +;color = +;convert = +extdiff = +;fetch = +;gpg = +;graphlog = +;hgcia = +;hgk = +;highlight = +;interhg = +;keyword = +;mq = +;notify = +;pager = +;parentrevspec = +;patchbomb = +;purge = +;rebase = +;record = +;transplant = +;win32mbcs = +;win32text = +;zeroconf = +; +; extra extensions provided by TortoiseHg +; +;qct = +;forest = + +; To use cleverencode/cleverdecode, you must enable win32text extension +; +; By default, we try to encode and decode all files that do not +; contain ASCII NUL characters. What this means is that we try to set +; line endings to Windows style on update, and to Unix style on +; commit. This lets us cooperate with Linux and Unix users, so +; everybody sees files with their native line endings. + +[encode] +; Encode files that don't contain NUL characters. + +; ** = cleverencode: + +; Alternatively, you can explicitly specify each file extension that +; you want encoded (any you omit will be left untouched), like this: + +; *.txt = dumbencode: + + +[decode] +; Decode files that don't contain NUL characters. + +; ** = cleverdecode: + +; Alternatively, you can explicitly specify each file extension that +; you want decoded (any you omit will be left untouched), like this: + +; **.txt = dumbdecode: + + +; +; Define external diff commands +; +[extdiff] +cmd.vdiff = {app}\kdiff3 +;cmd.vdiff = C:\Progra~1\TortoiseSVN\bin\TortoiseMerge.exe +;cmd.vimdiff = gvim.exe +;opts.vimdiff = -f '+next' '+execute "DirDiff ".argv(0)." ".argv(1)' + +[qct] +;See http://bitbucket.org/tortoisehg/stable/wiki/FAQ for details +;path="C:\Program Files\qct\qct.exe" + +[hgk] +;See http://bitbucket.org/tortoisehg/stable/wiki/FAQ for details +;path={app}\scripts\hgk.cmd +;vdiff=vdiff + +; +; The git extended diff format will properly store binary files, +; file permission changes, and rename information that the normal +; patch format cannot cover. However it is also not 100% compatible +; with tools which expect normal patches. so enable these at your +; own risk. +; +[diff] +;git = false +;nodates = false + +; +; Some optional defaults +; +[defaults] +;view = --limit 100 +;log = --limit 100 +;revert = --no-backup +;log = --style=changelog + +; +; Keyword extension example configuration. To use, one must +; enable the keyword extension, then uncomment and modify these +; two sections. Before using the keyword extension, be sure to +; thoroughly read it's documentation and understand how it works, +; and why it is not a core feature of Mercurial. +; +; http://www.selenic.com/mercurial/wiki/index.cgi/KeywordExtension +; http://www.selenic.com/mercurial/wiki/index.cgi/KeywordPlan +; +; If you encounter strange problems using Mercurial, a good first +; debugging step would be to disable this extension. +; +[keyword] +; expand keywords in all python files in working dir +;**.py = + +[keywordmaps] +; See documentation for examples
Change 1 of 1 Show Entire File contrib/​win32/​mercurial.iss Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
@@ -0,0 +1,214 @@
+; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +[Setup] +AppCopyright=Copyright 2005-2009 Matt Mackall and others +AppName=TortoiseHg +AppVerName=TortoiseHg-0.7 +InfoAfterFile=contrib/win32/postinstall.txt +LicenseFile=COPYING.txt +ShowLanguageDialog=yes +AppPublisher=TK Soh and others +AppPublisherURL=http://bitbucket.org/tortoisehg/stable/ +AppSupportURL=http://bitbucket.org/tortoisehg/stable/ +AppUpdatesURL=http://bitbucket.org/tortoisehg/stable/ +AppID=TortoiseHg +AppContact=teekaysoh@gmail.com +OutputBaseFilename=TortoiseHg-0.7 +DefaultDirName={pf}\TortoiseHg +SourceDir=..\.. +VersionInfoDescription=Mercurial distributed SCM +VersionInfoCopyright=Copyright 2005-2009 Matt Mackall and others +VersionInfoCompany=Matt Mackall and others +InternalCompressLevel=max +SolidCompression=true +SetupIconFile=..\icons\hgicon.ico +UninstallDisplayIcon={app}\hgicon.ico +WizardImageFile=..\icons\install-wizard.bmp +WizardImageStretch=no +WizardImageBackColor=$ffffff +WizardSmallImageFile=..\icons\install-wizard-small.bmp +AllowNoIcons=true +DefaultGroupName=TortoiseHg +PrivilegesRequired=poweruser +AlwaysRestart=yes +SetupLogging=yes + +[Files] +Source: contrib\mercurial.el; DestDir: {app}/contrib +Source: contrib\vim\*.*; DestDir: {app}/contrib/Vim +Source: contrib\zsh_completion; DestDir: {app}/contrib +Source: contrib\hgk; DestDir: {app}/contrib +Source: contrib\win32\ReadMe.html; DestDir: {app}; Flags: isreadme +Source: {app}\Mercurial.ini; DestDir: {app}\backup; Flags: external skipifsourcedoesntexist uninsneveruninstall +Source: contrib\win32\mercurial.ini; DestDir: {app}; DestName: Mercurial.ini; AfterInstall: FileExpandString('{app}\Mercurial.ini') +Source: ..\stable.snap; DestDir: {app}; DestName: ReleaseNotes.txt +Source: ..\contrib\*.exe; DestDir: {app}; Flags: ignoreversion restartreplace uninsrestartdelete +Source: ..\contrib\TortoiseOverlays\*.*; DestDir: {app}/TortoiseOverlays; +Source: dist\*.exe; DestDir: {app}; Flags: ignoreversion restartreplace uninsrestartdelete +Source: dist\*.dll; DestDir: {app}; Flags: ignoreversion restartreplace uninsrestartdelete +Source: dist\*.pyd; DestDir: {app}; Flags: ignoreversion restartreplace uninsrestartdelete +Source: dist\library.zip; DestDir: {app} +Source: doc\*.html; DestDir: {app}\docs +Source: icons\*; DestDir: {app}\icons; Flags: ignoreversion recursesubdirs createallsubdirs +Source: dist\share\*; DestDir: {app}\share; Flags: ignoreversion recursesubdirs createallsubdirs +Source: dist\lib\*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs createallsubdirs +Source: dist\etc\*; DestDir: {app}\etc; Flags: ignoreversion recursesubdirs createallsubdirs +Source: templates\*.*; DestDir: {app}\templates; Flags: recursesubdirs createallsubdirs +Source: locale\*.*; DestDir: {app}\locale; Flags: recursesubdirs createallsubdirs +Source: i18n\*.*; DestDir: {app}\i18n; Flags: +Source: CONTRIBUTORS; DestDir: {app}; DestName: Contributors.txt +Source: COPYING.txt; DestDir: {app}; DestName: Copying.txt +Source: ..\icons\hgicon.ico; DestDir: {app} +Source: ..\files\gtkrc; DestDir: {app}\etc\gtk-2.0; AfterInstall: EditOptions() + +[INI] +Filename: {app}\Mercurial.url; Section: InternetShortcut; Key: URL; String: http://www.selenic.com/mercurial/ +Filename: {app}\TortoiseHg.url; Section: InternetShortcut; Key: URL; String: http://bitbucket.org/tortoisehg/stable/ + +[Icons] +Name: {group}\TortoiseHg Web Site; Filename: {app}\TortoiseHg.url +Name: {group}\Mercurial Web Site; Filename: {app}\Mercurial.url +Name: {group}\Mercurial Command Reference; Filename: {app}\docs\hg.1.html +Name: {group}\Python Trace Collector; Filename: {app}\tracelog.exe +Name: {group}\Uninstall TortoiseHg; Filename: {uninstallexe} + +[Run] +Filename: {app}\add_path.exe; Parameters: {app}; StatusMsg: Adding the installation path to the search path... +Filename: msiexec.exe; Parameters: "/i ""{app}\TortoiseOverlays\TortoiseOverlays-1.0.4.11886-win32.msi"" /qn /norestart ALLUSERS=1"; StatusMsg: Installing TortoiseOverlays.dll ... +Filename: regsvr32.exe; Parameters: "/s ""{app}\tortoisehg.dll"""; StatusMsg: Installing shell extension... + +[UninstallRun] +Filename: {app}\add_path.exe; Parameters: /del {app} +Filename: regsvr32.exe; Parameters: "/s /u ""{app}\tortoisehg.dll""" + +[UninstallDelete] +Type: files; Name: {app}\Mercurial.url +Type: files; Name: {app}\TortoiseHg.url + +[Registry] +Root: HKLM; Subkey: Software\TortoiseHg; Flags: uninsdeletekey; ValueData: {app} +Root: HKLM; Subkey: Software\Mercurial; Flags: uninsdeletekey; ValueData: {app}\Mercurial.ini + +[Code] +procedure FileExpandString(fn: String); +var + InFile: String; + i: Integer; + InFileLines: TArrayOfString; +begin + InFile := ExpandConstant(fn); + LoadStringsFromFile(InFile, InFileLines); + for i:= 0 to GetArrayLength(InFileLines)-1 do + InFileLines[i] := ExpandConstant(InFileLines[i]); + SaveStringsToFile(InFile, InFileLines, False); +end; + +var ThemePage: TInputOptionWizardPage; +var IsUpgrade: Boolean; + +procedure InitializeWizard; +begin + ThemePage := CreateInputOptionPage(wpSelectComponents, + 'Theme Selection', '', + 'Please select a theme, then click Next.', + True, False); + ThemePage.Add('Neutrino (recommended, especially on Vista)'); + ThemePage.Add('Brushed'); + ThemePage.Add('Blue-Steel'); + ThemePage.Add('MS-Windows (original)'); + + case GetPreviousData('Theme', '') of + 'Neutrino': ThemePage.SelectedValueIndex := 0; + 'Brushed': ThemePage.SelectedValueIndex := 1; + 'Blue-Steel': ThemePage.SelectedValueIndex := 2; + 'MS-Windows': ThemePage.SelectedValueIndex := 3; + else + ThemePage.SelectedValueIndex := 0; + end; +end; + +procedure RegisterPreviousData(PreviousDataKey: Integer); +var + Theme: String; +begin + { Store the settings so we can restore them next time } + case ThemePage.SelectedValueIndex of + 0: Theme := 'Neutrino'; + 1: Theme := 'Brushed'; + 2: Theme := 'Blue-Steel'; + 3: Theme := 'MS-Windows'; + end; + SetPreviousData(PreviousDataKey, 'Theme', Theme); +end; + +procedure SetCommentMarker(var lines: TArrayOfString; option: String; selected: boolean); +var + i : integer; +begin + if selected then exit; + for i := 0 to pred(GetArrayLength(lines)) do + if pos(option, lines[i]) > 0 then + begin + lines[i][1] := '#'; + end; +end; + +procedure EditOptions(); +var + lines : TArrayOfString; + filename : String; +begin + filename := ExpandConstant(CurrentFilename); + LoadStringsFromFile(filename, lines); + + SetCommentMarker(lines, 'gtk-theme-name = "Neutrino"', ThemePage.SelectedValueIndex = 0); + SetCommentMarker(lines, 'gtk-theme-name = "Brushed"', ThemePage.SelectedValueIndex = 1); + SetCommentMarker(lines, 'gtk-theme-name = "Blue-Steel"', ThemePage.SelectedValueIndex = 2); + SetCommentMarker(lines, 'gtk-theme-name = "MS-Windows"', ThemePage.SelectedValueIndex = 3); + + SaveStringsToFile(filename, lines, False); +end; + +function InitializeSetup(): Boolean; +var + ThgSwReg: String; + CRLF: String; + msg: String; +begin + CRLF := chr(10) + chr(13); + Result := True; + + {abort installation if TortoiseHg 0.4 or earlier is installed} + if RegQueryStringValue(HKLM, 'Software\TortoiseHg', '', ThgSwReg) then + begin + IsUpgrade := True; + {gpyfm was unbundled after 0.4, so it's a good guess} + if (FileExists(ThgSwReg + '\gpyfm.exe')) then + begin + msg := 'TortoiseHg Setup Error:' + CRLF + CRLF + + 'The version of TortoiseHg installed is too old to upgrade in place.' + CRLF + + 'You must uninstall it before installing this version.' + CRLF + CRLF + + 'Please uninstall the existing version, then run the installer again ' + + 'to continue.'; + MsgBox(msg, mbError, MB_OK); + Result := False; {quit and abort installation} + end else begin + msg := 'Your current site-wide Mercurial.ini will be copied into' + CRLF + + ThgSwReg + '\backup' + CRLF + + 'After install you may merge changes back into the new Mercurial.ini' + MsgBox(msg, mbInformation, MB_OK); + end; + end; +end; + +function ShouldSkipPage(PageID: Integer): Boolean; +begin + { Skip wpSelectDir page if upgrading; show all others } + case PageID of + wpSelectDir: + Result := IsUpgrade; + else + Result := False; + end; +end;
Change 1 of 1 Show Entire File contrib/​win32/​setup.cfg Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
@@ -0,0 +1,11 @@
+[py2exe] +excludes=pywin, pywin.dialogs, pywin.dialogs.list, PyQt, PyQt4.QtCode, PyQt4.QtGui +includes=cairo, pango, pangocairo, atk, gobject, dbhash +packages=email, hgext, hgext.convert, encodings, hggtk, hggtk.vis, hggtk.iniparse, tortoise + +# Disabled for 0.7 release +#dll_excludes=iconv.dll, intl.dll, libatk-1.0-0.dll, libgdk_pixbuf-2.0-0.dll, libgdk-win32-2.0-0.dll, libglib-2.0-0.dll, libgmodule-2.0-0.dll, libgobject-2.0-0.dll, libgthread-2.0-0.dll, libgtk-win32-2.0-0.dll, libpango-1.0-0.dll, libpangowin32-1.0-0.dll, libcairo-2.dll, libglade-2.0-0.dll, libpangocairo-1.0-0.dll, libpangoft2-1.0-0.dll + + +[build] +compiler=mingw32
Change 1 of 1 Show Entire File contrib/​win32/​setup.py Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
@@ -0,0 +1,234 @@
+#!/usr/bin/env python +# +# This is the mercurial setup script. +# +# 'python setup.py install', or +# 'python setup.py --help' for more options + +import sys +if not hasattr(sys, 'version_info') or sys.version_info < (2, 3, 0, 'final'): + raise SystemExit("Mercurial requires python 2.3 or later.") + +# Solaris Python packaging brain damage +try: + import hashlib + sha = hashlib.sha1() +except: + try: + import sha + except: + raise SystemExit( + "Couldn't import standard hashlib (incomplete Python install).") + +try: + import zlib +except: + raise SystemExit( + "Couldn't import standard zlib (incomplete Python install).") + +import os, time +import shutil +import tempfile +from distutils.core import setup, Extension +from distutils.dist import Distribution +from distutils.command.install_data import install_data +from distutils.command.build import build +from distutils.command.build_py import build_py +from distutils.spawn import spawn, find_executable +from distutils.ccompiler import new_compiler + +extra = {} +scripts = ['hg'] +if os.name == 'nt': + scripts.append('contrib/win32/hg.bat') + +# simplified version of distutils.ccompiler.CCompiler.has_function +# that actually removes its temporary files. +def has_function(cc, funcname): + tmpdir = tempfile.mkdtemp(prefix='hg-install-') + devnull = oldstderr = None + try: + try: + fname = os.path.join(tmpdir, 'funcname.c') + f = open(fname, 'w') + f.write('int main(void) {\n') + f.write(' %s();\n' % funcname) + f.write('}\n') + f.close() + # Redirect stderr to /dev/null to hide any error messages + # from the compiler. + # This will have to be changed if we ever have to check + # for a function on Windows. + devnull = open('/dev/null', 'w') + oldstderr = os.dup(sys.stderr.fileno()) + os.dup2(devnull.fileno(), sys.stderr.fileno()) + objects = cc.compile([fname]) + cc.link_executable(objects, os.path.join(tmpdir, "a.out")) + except: + return False + return True + finally: + if oldstderr is not None: + os.dup2(oldstderr, sys.stderr.fileno()) + if devnull is not None: + devnull.close() + shutil.rmtree(tmpdir) + +# py2exe needs to be installed to work +try: + import py2exe + + # Help py2exe to find win32com.shell + try: + import modulefinder + import win32com + for p in win32com.__path__[1:]: # Take the path to win32comext + modulefinder.AddPackagePath("win32com", p) + pn = "win32com.shell" + __import__(pn) + m = sys.modules[pn] + for p in m.__path__[1:]: + modulefinder.AddPackagePath(pn, p) + except ImportError: + pass + + extra['windows'] = [ + {'script':'contrib/tracelog.py', + 'icon_resources':[(1, 'icons/tortoise/python.ico')]} + ] + extra['com_server'] = ['tortoisehg'] + extra['console'] = ['hg', 'hgtk'] + +except ImportError: + pass + +try: + from mercurial.__version__ import version +except ImportError: + version = 'unknown' + +class install_package_data(install_data): + def finalize_options(self): + self.set_undefined_options('install', + ('install_lib', 'install_dir')) + install_data.finalize_options(self) + +class build_mo(build): + + description = "build translations (.mo files)" + + def run(self): + if not find_executable('msgfmt'): + self.warn("could not find msgfmt executable, no translations " + "will be built") + return + + podir = 'i18n' + if not os.path.isdir(podir): + self.warn("could not find %s/ directory" % podir) + return + + join = os.path.join + for po in os.listdir(podir): + if not po.endswith('.po'): + continue + pofile = join(podir, po) + modir = join('locale', po[:-3], 'LC_MESSAGES') + mofile = join(modir, 'hg.mo') + cmd = ['msgfmt', '-v', '-o', mofile, pofile] + if sys.platform != 'sunos5': + # msgfmt on Solaris does not know about -c + cmd.append('-c') + self.mkpath(modir) + self.make_file([pofile], mofile, spawn, (cmd,)) + self.distribution.data_files.append((join('mercurial', modir), + [mofile])) + +build.sub_commands.append(('build_mo', None)) + +Distribution.pure = 0 +Distribution.global_options.append(('pure', None, "use pure (slow) Python " + "code instead of C extensions")) + +class hg_build_py(build_py): + + def finalize_options(self): + build_py.finalize_options(self) + + if self.distribution.pure: + if self.py_modules is None: + self.py_modules = [] + for ext in self.distribution.ext_modules: + if ext.name.startswith("mercurial."): + self.py_modules.append("mercurial.pure.%s" % ext.name[10:]) + self.distribution.ext_modules = [] + + def find_modules(self): + modules = build_py.find_modules(self) + for module in modules: + if module[0] == "mercurial.pure": + if module[1] != "__init__": + yield ("mercurial", module[1], module[2]) + else: + yield module + +cmdclass = {'install_data': install_package_data, + 'build_mo': build_mo, + 'build_py': hg_build_py} + +ext_modules=[ + Extension('mercurial.base85', ['mercurial/base85.c']), + Extension('mercurial.bdiff', ['mercurial/bdiff.c']), + Extension('mercurial.diffhelpers', ['mercurial/diffhelpers.c']), + Extension('mercurial.mpatch', ['mercurial/mpatch.c']), + Extension('mercurial.parsers', ['mercurial/parsers.c']), + ] + +packages = ['mercurial', 'mercurial.hgweb', 'hgext', 'hgext.convert', + 'hgext.highlight', 'hgext.zeroconf', 'hggtk', 'hggtk.vis', + 'hggtk.iniparse', 'tortoise'] + +try: + import msvcrt + ext_modules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'])) +except ImportError: + pass + +try: + import posix + ext_modules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'])) + + if sys.platform == 'linux2' and os.uname()[2] > '2.6': + # The inotify extension is only usable with Linux 2.6 kernels. + # You also need a reasonably recent C library. + cc = new_compiler() + if has_function(cc, 'inotify_add_watch'): + ext_modules.append(Extension('hgext.inotify.linux._inotify', + ['hgext/inotify/linux/_inotify.c'])) + packages.extend(['hgext.inotify', 'hgext.inotify.linux']) +except ImportError: + pass + +datafiles = [] +for root in ('templates', 'i18n'): + for dir, dirs, files in os.walk(root): + datafiles.append((os.path.join('mercurial', dir), + [os.path.join(dir, file_) for file_ in files])) + +setup(name='mercurial', + version=version, + author='Matt Mackall', + author_email='mpm@selenic.com', + url='http://selenic.com/mercurial', + description='Scalable distributed SCM', + license='GNU GPL', + scripts=scripts, + packages=packages, + ext_modules=ext_modules, + data_files=datafiles, + cmdclass=cmdclass, + options=dict(bdist_mpkg=dict(zipdist=True, + license='COPYING', + readme='contrib/macosx/Readme.html', + welcome='contrib/macosx/Welcome.html')), + **extra)
Change 1 of 1 Show Entire File hggtk/​__init__.py Stacked
 
1
2
3
4
5
6
7
8
9
 
 
 
 
 
 
 
 
 
 
 
1
@@ -1,9 +1,1 @@
-import pygtk -pygtk.require('2.0') -import gtk - -# Default icon for apps which do not set one -from shlib import get_tortoise_icon -icon = get_tortoise_icon("hg.ico") -if icon: - gtk.window_set_default_icon_from_file(icon) +#placeholder
Change 1 of 4 Show Entire File hggtk/​about.py Stacked
 
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
 
 
 
 
23
24
25
26
27
28
29
 
30
31
32
 
38
39
40
41
 
42
43
44
45
46
47
 
48
49
50
 
51
52
53
 
55
56
57
58
59
 
 
60
61
62
 
65
66
67
68
69
70
71
 
 
 
 
 
 
 
 
 
72
73
74
75
76
77
78
79
80
 
81
82
83
84
85
86
87
88
 
 
89
90
91
 
 
 
6
7
8
 
 
 
9
 
 
 
 
 
 
 
 
 
 
10
11
12
13
14
15
16
17
18
19
20
 
21
22
23
24
 
30
31
32
 
33
34
35
36
37
38
 
39
40
41
42
43
44
45
46
 
48
49
50
 
 
51
52
53
54
55
 
58
59
60
 
 
 
 
61
62
63
64
65
66
67
68
69
70
 
71
72
73
 
 
 
 
74
75
 
 
 
 
 
 
 
76
77
78
 
 
79
80
@@ -6,27 +6,19 @@
   import os  import sys - -import pygtk -pygtk.require('2.0')  import gtk -import shlib - -try: - # post 1.1.2 - from mercurial import util - hgversion = util.version() -except AttributeError: - # <= 1.1.2 - from mercurial import version - hgversion = version.get_version() +import gtklib +from thgutil.i18n import _ +from thgutil.hglib import hgversion +from thgutil import shlib +from thgutil import paths    def browse_url(url):   import threading   def start_browser():   if os.name == 'nt':   import win32api, win32con - win32api.ShellExecute(0, "open", url, None, "", + win32api.ShellExecute(0, "open", url, None, "",   win32con.SW_SHOW)   else:   import gconf @@ -38,16 +30,17 @@
   def url_handler(dialog, link, user_data):   browse_url(link) - +  gtk.about_dialog_set_url_hook(url_handler, None)    def make_version(tuple):   vers = ".".join([str(x) for x in tuple])   return vers - +  class AboutDialog(gtk.AboutDialog):   def __init__(self):   super(AboutDialog, self).__init__() + gtklib.set_tortoise_keys(self)     lib_versions = ', '.join([   "Mercurial-%s" % hgversion, @@ -55,8 +48,8 @@
  "PyGTK-%s" % make_version(gtk.pygtk_version),   "GTK-%s" % make_version(gtk.gtk_version),   ]) - - comment = "Several icons are courtesy of the TortoiseSVN project" + + comment = _("Several icons are courtesy of the TortoiseSVN project")     self.set_website("http://bitbucket.org/tortoisehg/stable/")   self.set_name("TortoiseHg") @@ -65,27 +58,23 @@
  self.set_wrap_license(True)   self.set_copyright("Copyright 2009 TK Soh and others")   - thg_logo = os.path.normpath(shlib.get_tortoise_icon('thg_logo_92x50.png')) - thg_icon = os.path.normpath(shlib.get_tortoise_icon('thg_logo.ico')) - prog_root = os.path.dirname(os.path.dirname(os.path.dirname(thg_icon))) - license_file = os.path.join(prog_root, "COPYING.txt") + thg_logo = paths.get_tortoise_icon('thg_logo_92x50.png') + thg_icon = paths.get_tortoise_icon('thg_logo.ico') + try: + license_file = paths.get_license_path() + self.set_license(file(license_file).read()) + except IOError: + import hgtk + license = hgtk.shortlicense.splitlines()[1:] + self.set_license('\n'.join(license))   - self.set_license(file(license_file).read())   self.set_comments("with " + lib_versions + "\n\n" + comment)   self.set_logo(gtk.gdk.pixbuf_new_from_file(thg_logo))   self.set_icon_from_file(thg_icon) - - # somehow clicking on the Close button doesn't automatically - # close the About dialog... - self.connect('response', gtk.main_quit) + self.connect('response', self.response)   -def run(*args, **opts): - dialog = AboutDialog() - dialog.show_all() - gtk.gdk.threads_init() - gtk.gdk.threads_enter() - gtk.main() - gtk.gdk.threads_leave() + def response(self, widget, respid): + self.destroy()   -if __name__ == "__main__": - run() +def run(_ui, *pats, **opts): + return AboutDialog()
Change 1 of 1 Show Entire File hggtk/​addremove.py Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,50 +0,0 @@
-# -# Add/Remove dialog for TortoiseHg -# -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# - -try: - import pygtk - pygtk.require("2.0") -except: - pass - -import gtk -import gobject -from mercurial import ui, util, hg -from mercurial.i18n import _ -from status import GStatus - -def run(hgcmd='add', root='', cwd='', files=[], **opts): - u = ui.ui() - u.updateopts(debug=False, traceback=False) - repo = hg.repository(u, path=root) - - cmdoptions = { - 'all':False, 'clean':False, 'ignored':False, 'modified':False, - 'added':True, 'removed':True, 'deleted':True, 'unknown':False, 'rev':[], - 'exclude':[], 'include':[], 'debug':True,'verbose':True - } - - if hgcmd == 'add': - cmdoptions['unknown'] = True - elif hgcmd == 'remove': - cmdoptions['clean'] = True - else: - raise "Invalid command '%s'" % hgcmd - - dialog = GStatus(u, repo, cwd, files, cmdoptions, True) - - gtk.gdk.threads_init() - gtk.gdk.threads_enter() - dialog.display() - gtk.main() - gtk.gdk.threads_leave() - -if __name__ == "__main__": - import sys - opts = {} - opts['hgcmd'] = 'adda' - opts['root'] = len(sys.argv) > 1 and sys.argv[1] or '' - run(**opts)
Show Entire File hggtk/​backout.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​bugreport.py Stacked
copied from hggtk/status.py
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​changeset.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​clone.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​commit.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​datamine.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​dialog.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​diff.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​gdialog.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​gtklib.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​gtools.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​guess.py Stacked
copied from hggtk/rename.py
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​hgcmd.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​hgemail.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​hgignore.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​hginit.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​hgshelve.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​hgthread.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​hgtk.py Stacked
renamed from contrib/hgtk
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​history.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​histselect.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​logfilter.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​logview/​__init__.py Stacked
renamed from hggtk/vis/__init__.py
(No changes)
Show Entire File hggtk/​logview/​colormap.py Stacked
renamed from hggtk/vis/colormap.py
(No changes)
Show Entire File hggtk/​logview/​graphcell.py Stacked
renamed from hggtk/vis/graphcell.py
(No changes)
Change 1 of 2 Show Entire File hggtk/​logview/​revgraph.py Stacked
renamed from hggtk/vis/revgraph.py
 
14
15
16
17
 
18
19
20
 
37
38
39
 
 
 
40
41
42
 
14
15
16
 
17
18
19
20
 
37
38
39
40
41
42
43
44
45
@@ -14,7 +14,7 @@
 def __get_parents(repo, rev):   return [x for x in repo.changelog.parentrevs(rev) if x != nullrev]   -def revision_grapher(repo, start_rev, stop_rev, branch=None): +def revision_grapher(repo, start_rev, stop_rev, branch=None, noheads=False):   """incremental revision grapher     This generator function walks through the revision history from @@ -37,6 +37,9 @@
  while curr_rev >= stop_rev:   # Compute revs and next_revs.   if curr_rev not in revs: + if noheads and curr_rev != start_rev: + curr_rev -= 1 + continue   if branch:   ctx = repo.changectx(curr_rev)   if ctx.branch() != branch:
Show Entire File hggtk/​logview/​treemodel.py Stacked
renamed from hggtk/vis/treemodel.py
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​logview/​treeview.py Stacked
renamed from hggtk/vis/treeview.py
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​merge.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​recovery.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​rename.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​revisions.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​revtree.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​serve.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​status.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​synch.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​tagadd.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​tags.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​thgconfig.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​thgshelve.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​update.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hggtk/​visdiff.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File hgproc.bat Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,20 +0,0 @@
-:: -:: Win32 batch file to handle TortoiseHg external proc calls -:: - -@echo off -setlocal - -:: Look in the registry for TortoiseHg location -for /f "skip=2 tokens=3*" %%A in ( - '"reg query "HKEY_LOCAL_MACHINE\SOFTWARE\TortoiseHg" /ve 2> nul"' ) do set TortoisePath=%%B -if "%TortoisePath%"=="" (goto :notfound) else (goto :hgproc) - -:hgproc -python "%TortoisePath%\hgproc.py" %* -goto end - -:notfound -echo hgproc: cannot find TortoiseHg location in the registry. - -:end \ No newline at end of file
Show Entire File hgproc.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File hgtk Stacked
This file's diff was not loaded because this changeset is very large. Load changes
icons/​TortoiseMerge.ico Side by side
renamed from icons/tortoise/TortoiseMerge.ico
Removed image
Added image
Subtracted image Added image
Removed image
Removed image
icons/​detect_rename.ico Side by side
renamed from icons/tortoise/detect_rename.ico
Removed image
Added image
Subtracted image Added image
Removed image
Removed image
icons/​general.ico Side by side
renamed from icons/tortoise/general.ico
Removed image
Added image
Subtracted image Added image
icons/​hg.ico Side by side
renamed from icons/tortoise/hg.ico
Removed image
Added image
Subtracted image Added image
icons/​hg_60.ico Side by side
renamed from icons/tortoise/hg_60.ico
Removed image
Added image
Subtracted image Added image
icons/​ignore.ico Side by side
renamed from icons/tortoise/ignore.ico
Removed image
Added image
Subtracted image Added image
Removed image
Removed image
icons/​menuabout.ico Side by side
renamed from icons/tortoise/menuabout.ico
Removed image
Added image
Subtracted image Added image
icons/​menuadd.ico Side by side
renamed from icons/tortoise/menuadd.ico
Removed image
Added image
Subtracted image Added image
icons/​menublame.ico Side by side
renamed from icons/tortoise/menublame.ico
Removed image
Added image
Subtracted image Added image
icons/​menucheckout.ico Side by side
renamed from icons/tortoise/menucheckout.ico
Removed image
Added image
Subtracted image Added image
icons/​menuclone.ico Side by side
renamed from icons/tortoise/menuclone.ico
Removed image
Added image
Subtracted image Added image
icons/​menucommit.ico Side by side
renamed from icons/tortoise/menucommit.ico
Removed image
Added image
Subtracted image Added image
icons/​menucreaterepos.ico Side by side
renamed from icons/tortoise/menucreaterepos.ico
Removed image
Added image
Subtracted image Added image
icons/​menudelete.ico Side by side
renamed from icons/tortoise/menudelete.ico
Removed image
Added image
Subtracted image Added image
icons/​menudiff.ico Side by side
renamed from icons/tortoise/menudiff.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​menuhelp.ico Side by side
renamed from icons/tortoise/menuhelp.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​menulog.ico Side by side
renamed from icons/tortoise/menulog.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​menumerge.ico Side by side
renamed from icons/tortoise/menumerge.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​menurelocate.ico Side by side
renamed from icons/tortoise/menurelocate.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​menurepobrowse.ico Side by side
renamed from icons/tortoise/menurepobrowse.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​menurevert.ico Side by side
renamed from icons/tortoise/menurevert.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​menurevisiongraph.ico Side by side
renamed from icons/tortoise/menurevisiongraph.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​menusettings.ico Side by side
renamed from icons/tortoise/menusettings.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​menushowchanged.ico Side by side
renamed from icons/tortoise/menushowchanged.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​menusynch.ico Side by side
renamed from icons/tortoise/menusynch.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​menuunmerge.ico Side by side
renamed from icons/tortoise/menuunmerge.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​proxy.ico Side by side
renamed from icons/tortoise/proxy.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​python.ico Side by side
renamed from icons/tortoise/python.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​settings_repo.ico Side by side
renamed from icons/tortoise/settings_repo.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​settings_user.ico Side by side
renamed from icons/tortoise/settings_user.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​shelve.ico Side by side
renamed from icons/tortoise/shelve.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
This image was not loaded automatically because this changeset is very large. Click to load this image...
Show Entire File icons/​svg/​add.svg Stacked
renamed from icons/tortoise/svg/add.svg
(No changes)
Show Entire File icons/​svg/​checkout.svg Stacked
renamed from icons/tortoise/svg/checkout.svg
(No changes)
Show Entire File icons/​svg/​clone.svg Stacked
renamed from icons/tortoise/svg/clone.svg
(No changes)
Show Entire File icons/​svg/​commit.svg Stacked
renamed from icons/tortoise/svg/commit.svg
(No changes)
Show Entire File icons/​svg/​detect_rename.svg Stacked
renamed from icons/tortoise/svg/detect_rename.svg
(No changes)
Show Entire File icons/​svg/​ignore.svg Stacked
renamed from icons/tortoise/svg/ignore.svg
(No changes)
Show Entire File icons/​svg/​init.svg Stacked
renamed from icons/tortoise/svg/init.svg
(No changes)
Show Entire File icons/​svg/​log.svg Stacked
renamed from icons/tortoise/svg/log.svg
(No changes)
Show Entire File icons/​svg/​merge.svg Stacked
renamed from icons/tortoise/svg/merge.svg
(No changes)
Show Entire File icons/​svg/​proxy.svg Stacked
renamed from icons/tortoise/svg/proxy.svg
(No changes)
Show Entire File icons/​svg/​recovery.svg Stacked
renamed from icons/tortoise/svg/recovery.svg
(No changes)
Show Entire File icons/​svg/​remove.svg Stacked
renamed from icons/tortoise/svg/remove.svg
(No changes)
Show Entire File icons/​svg/​repobrowse.svg Stacked
renamed from icons/tortoise/svg/repobrowse.svg
(No changes)
Show Entire File icons/​svg/​revert.svg Stacked
renamed from icons/tortoise/svg/revert.svg
(No changes)
Show Entire File icons/​svg/​shelve.svg Stacked
renamed from icons/tortoise/svg/shelve.svg
(No changes)
Show Entire File icons/​svg/​status.svg Stacked
renamed from icons/tortoise/svg/status.svg
(No changes)
Show Entire File icons/​svg/​sync.svg Stacked
renamed from icons/tortoise/svg/sync.svg
(No changes)
Show Entire File icons/​svg/​thg_logo.svg Stacked
renamed from icons/tortoise/svg/thg_logo.svg
(No changes)
icons/​thg_logo.ico Side by side
renamed from icons/tortoise/thg_logo.ico
This image was not loaded automatically because this changeset is very large. Click to load this image...
icons/​thg_logo_92x50.png Side by side
renamed from icons/tortoise/thg_logo_92x50.png
This image was not loaded automatically because this changeset is very large. Click to load this image...
Show Entire File installer/​build.txt Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File installer/​tortoisehg.iss Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File setup.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File thgutil/​__init__.py Stacked
 
 
 
1
@@ -0,0 +1,1 @@
+#placeholder
Show Entire File thgutil/​cachethg.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File thgutil/​debugthg.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File thgutil/​hglib.py Stacked
renamed from hggtk/hglib.py
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File thgutil/​i18n.py Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@@ -0,0 +1,14 @@
+""" +i18n.py + Copyright (C) 2009 Steve Borho <steve@borho.org> + +This software may be used and distributed according to the terms +of the GNU General Public License, incorporated herein by reference. +""" + +import gettext +from gettext import gettext as _ +import paths + +gettext.bindtextdomain("thg", paths.get_locale_path()) +gettext.textdomain("thg")
Show Entire File thgutil/​iniparse/​__init__.py Stacked
renamed from hggtk/iniparse/__init__.py
(No changes)
Show Entire File thgutil/​iniparse/​compat.py Stacked
renamed from hggtk/iniparse/compat.py
(No changes)
Show Entire File thgutil/​iniparse/​config.py Stacked
renamed from hggtk/iniparse/config.py
(No changes)
Show Entire File thgutil/​iniparse/​ini.py Stacked
renamed from hggtk/iniparse/ini.py
(No changes)
Show Entire File thgutil/​menuthg.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File thgutil/​paths.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File thgutil/​shlib.py Stacked
renamed from hggtk/shlib.py
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File thgutil/​thread2.py Stacked
renamed from hggtk/thread2.py
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File tortoise/​__init__.py Stacked
 
1
2
3
4
5
6
 
 
 
 
 
 
 
@@ -1,6 +0,0 @@
- -import gettext - -# Add '_' to the builtin namespace -gettext.install('olive-gtk') -
Show Entire File tortoise/​contextmenu.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File tortoise/​iconoverlay.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File tortoise/​shellconf.py Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,14 +0,0 @@
-# Published under the GNU GPL, v2 or later. -# Copyright (C) 2007 Henry Ludemann <misc@hl.id.au> -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> - -from mercurial import ui - -# overlay icons display setting -show_overlay_icons = False - -def read(): - global show_overlay_icons - overlayicons = ui.ui().config('tortoisehg', 'overlayicons', '') - print "tortoisehg.overlayicons = ", overlayicons - show_overlay_icons = overlayicons != 'disabled'
Show Entire File tortoise/​test/​__init__.py Stacked
(No changes)
Show Entire File tortoise/​test/​testcontextmenu.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File tortoise/​test/​testiconoverlay.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File tortoise/​thgutil.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File tortoise/​thread2.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File tortoisehg.py Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File win32/​rpcserver.py Stacked
renamed from tortoise/rpcserver.py
(No changes)
Show Entire File win32/​shellext/​ContextMenu.cpp Stacked
renamed from tortoise/shellext/ContextMenu.cpp
(No changes)
Show Entire File win32/​shellext/​Directory.cpp Stacked
renamed from tortoise/shellext/Directory.cpp
(No changes)
Show Entire File win32/​shellext/​Directory.h Stacked
renamed from tortoise/shellext/Directory.h
(No changes)
Show Entire File win32/​shellext/​DirectoryStatus.cpp Stacked
renamed from tortoise/shellext/DirectoryStatus.cpp
(No changes)
Show Entire File win32/​shellext/​DirectoryStatus.h Stacked
renamed from tortoise/shellext/DirectoryStatus.h
(No changes)
Show Entire File win32/​shellext/​Direntry.cpp Stacked
renamed from tortoise/shellext/Direntry.cpp
(No changes)
Show Entire File win32/​shellext/​Direntry.h Stacked
renamed from tortoise/shellext/Direntry.h
(No changes)
Show Entire File win32/​shellext/​Dirstatecache.cpp Stacked
renamed from tortoise/shellext/Dirstatecache.cpp
(No changes)
Show Entire File win32/​shellext/​Dirstatecache.h Stacked
renamed from tortoise/shellext/Dirstatecache.h
(No changes)
Show Entire File win32/​shellext/​FixWinDefs.h Stacked
renamed from tortoise/shellext/FixWinDefs.h
(No changes)
Show Entire File win32/​shellext/​HgRepoRoot.cpp Stacked
renamed from tortoise/shellext/HgRepoRoot.cpp
(No changes)
Show Entire File win32/​shellext/​HgRepoRoot.h Stacked
renamed from tortoise/shellext/HgRepoRoot.h
(No changes)
Show Entire File win32/​shellext/​IconOverlay.cpp Stacked
renamed from tortoise/shellext/IconOverlay.cpp
(No changes)
Show Entire File win32/​shellext/​Makefile Stacked
renamed from tortoise/shellext/Makefile
(No changes)
Show Entire File win32/​shellext/​MenuActions.cpp Stacked
renamed from tortoise/shellext/MenuActions.cpp
(No changes)
Show Entire File win32/​shellext/​PipeUtils.cpp Stacked
renamed from tortoise/shellext/PipeUtils.cpp
(No changes)
Show Entire File win32/​shellext/​PipeUtils.h Stacked
renamed from tortoise/shellext/PipeUtils.h
(No changes)
Show Entire File win32/​shellext/​QueryDirstate.cpp Stacked
renamed from tortoise/shellext/QueryDirstate.cpp
(No changes)
Show Entire File win32/​shellext/​QueryDirstate.h Stacked
renamed from tortoise/shellext/QueryDirstate.h
(No changes)
Show Entire File win32/​shellext/​Registry.cpp Stacked
renamed from tortoise/shellext/Registry.cpp
(No changes)
Show Entire File win32/​shellext/​Registry.h Stacked
renamed from tortoise/shellext/Registry.h
(No changes)
Show Entire File win32/​shellext/​ShellExt.cpp Stacked
renamed from tortoise/shellext/ShellExt.cpp
(No changes)
Show Entire File win32/​shellext/​ShellExt.def Stacked
renamed from tortoise/shellext/ShellExt.def
(No changes)
Show Entire File win32/​shellext/​ShellExt.h Stacked
renamed from tortoise/shellext/ShellExt.h
(No changes)
Show Entire File win32/​shellext/​ShellUtils.cpp Stacked
renamed from tortoise/shellext/ShellUtils.cpp
(No changes)
Show Entire File win32/​shellext/​ShellUtils.h Stacked
renamed from tortoise/shellext/ShellUtils.h
(No changes)
Show Entire File win32/​shellext/​ShellUtils2.cpp Stacked
renamed from tortoise/shellext/ShellUtils2.cpp
(No changes)
Show Entire File win32/​shellext/​StringUtils.cpp Stacked
renamed from tortoise/shellext/StringUtils.cpp
(No changes)
Show Entire File win32/​shellext/​StringUtils.h Stacked
renamed from tortoise/shellext/StringUtils.h
(No changes)
Show Entire File win32/​shellext/​ThgShell.iss Stacked
renamed from tortoise/shellext/ThgShell.iss
(No changes)
Show Entire File win32/​shellext/​TortoiseUtils.cpp Stacked
renamed from tortoise/shellext/TortoiseUtils.cpp
(No changes)
Show Entire File win32/​shellext/​TortoiseUtils.h Stacked
renamed from tortoise/shellext/TortoiseUtils.h
(No changes)
Show Entire File win32/​shellext/​Winstat.cpp Stacked
renamed from tortoise/shellext/Winstat.cpp
(No changes)
Show Entire File win32/​shellext/​Winstat.h Stacked
renamed from tortoise/shellext/Winstat.h
(No changes)
Show Entire File win32/​shellext/​dirstate.cpp Stacked
renamed from tortoise/shellext/dirstate.cpp
(No changes)
Show Entire File win32/​shellext/​dirstate.h Stacked
renamed from tortoise/shellext/dirstate.h
(No changes)
Show Entire File win32/​shellext/​registry.iss Stacked
renamed from tortoise/shellext/registry.iss
(No changes)
Show Entire File win32/​shellext/​stdafx.h Stacked
renamed from tortoise/shellext/stdafx.h
(No changes)
Show Entire File win32/​taskbar.py Stacked
renamed from tortoise/taskbar.py
(No changes)