Show More
@@ -5,7 +5,7 b'' | |||||
5 | # instance) |
|
5 | # instance) | |
6 | # |
|
6 | # | |
7 | # Copyright (C) 2005 Steve Borho |
|
7 | # Copyright (C) 2005 Steve Borho | |
8 | # Copyright (C) 2006 Brendan Cully <brendan@kublai.com> |
|
8 | # Copyright (C) 2006-8 Brendan Cully <brendan@kublai.com> | |
9 | # |
|
9 | # | |
10 | # This is free software; you can redistribute it and/or modify it under |
|
10 | # This is free software; you can redistribute it and/or modify it under | |
11 | # the terms of the GNU General Public License as published by the Free |
|
11 | # the terms of the GNU General Public License as published by the Free | |
@@ -203,6 +203,30 b' typeset -A _hg_cmd_globals' | |||||
203 | _wanted files expl 'modified files' _multi_parts / status_files |
|
203 | _wanted files expl 'modified files' _multi_parts / status_files | |
204 | } |
|
204 | } | |
205 |
|
205 | |||
|
206 | _hg_resolve() { | |||
|
207 | local rstate rpah | |||
|
208 | ||||
|
209 | [[ -d $PREFIX ]] || PREFIX=$PREFIX:h | |||
|
210 | ||||
|
211 | _hg_cmd resolve -l ./$PREFIX 2> /dev/null | while read rstate rpath | |||
|
212 | do | |||
|
213 | [[ $rstate == 'R' ]] && resolved_files+=($rpath) | |||
|
214 | [[ $rstate == 'U' ]] && unresolved_files+=($rpath) | |||
|
215 | done | |||
|
216 | } | |||
|
217 | ||||
|
218 | _hg_resolved() { | |||
|
219 | typeset -a resolved_files unresolved_files | |||
|
220 | _hg_resolve | |||
|
221 | _wanted files expl 'resolved files' _multi_parts / resolved_files | |||
|
222 | } | |||
|
223 | ||||
|
224 | _hg_unresolved() { | |||
|
225 | typeset -a resolved_files unresolved_files | |||
|
226 | _hg_resolve | |||
|
227 | _wanted files expl 'unresolved files' _multi_parts / unresolved_files | |||
|
228 | } | |||
|
229 | ||||
206 | _hg_config() { |
|
230 | _hg_config() { | |
207 | typeset -a items |
|
231 | typeset -a items | |
208 | items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*}) |
|
232 | items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*}) | |
@@ -580,7 +604,26 b' typeset -A _hg_cmd_globals' | |||||
580 | '*:file:_hg_files' |
|
604 | '*:file:_hg_files' | |
581 | } |
|
605 | } | |
582 |
|
606 | |||
|
607 | _hg_cmd_resolve() { | |||
|
608 | local context state line | |||
|
609 | typeset -A opt_args | |||
|
610 | ||||
|
611 | _arguments -s -w : $_hg_global_opts \ | |||
|
612 | '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \ | |||
|
613 | '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \ | |||
|
614 | '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' | |||
|
615 | ||||
|
616 | if [[ $state == 'resolve_files' ]] | |||
|
617 | then | |||
|
618 | _alternative 'files:resolved files:_hg_resolved' \ | |||
|
619 | 'files:unresolved files:_hg_unresolved' | |||
|
620 | fi | |||
|
621 | } | |||
|
622 | ||||
583 | _hg_cmd_revert() { |
|
623 | _hg_cmd_revert() { | |
|
624 | local context state line | |||
|
625 | typeset -A opt_args | |||
|
626 | ||||
584 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
627 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | |
585 | '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \ |
|
628 | '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \ | |
586 | '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_tags' \ |
|
629 | '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_tags' \ |
General Comments 0
You need to be logged in to leave comments.
Login now