about summary refs log tree commit diff
path: root/Completion/Unix/Command/_perforce
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-05-19 11:10:47 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-05-19 11:10:47 +0000
commit3971345ee6474db629e27c489231645ffa2eac91 (patch)
treeb21bdb8d7a2244c27794e9c7c02065b5dcd09356 /Completion/Unix/Command/_perforce
parent319af866112d35dd65ab5c7fc9fe70310a4a7748 (diff)
downloadzsh-3971345ee6474db629e27c489231645ffa2eac91.tar.gz
zsh-3971345ee6474db629e27c489231645ffa2eac91.tar.xz
zsh-3971345ee6474db629e27c489231645ffa2eac91.zip
unposted: _perforce: minor tweak to revision syntax
Diffstat (limited to 'Completion/Unix/Command/_perforce')
-rw-r--r--Completion/Unix/Command/_perforce17
1 files changed, 14 insertions, 3 deletions
diff --git a/Completion/Unix/Command/_perforce b/Completion/Unix/Command/_perforce
index 7083470d6..b7b429c17 100644
--- a/Completion/Unix/Command/_perforce
+++ b/Completion/Unix/Command/_perforce
@@ -124,6 +124,17 @@
 # backslash, as before.  The # and @ are never added automatically; you
 # have to select one by hand.
 #
+# Perforce allows change and revision numbers to be preceded by =, <, <=, >
+# or >=.  See `p4 help undoc' for details.  (In particular, `=' is
+# an extremely useful shortcut when integrating single changes.)
+# This syntax is handled, but currently the < and > must be quoted
+# with a backslash, not by any other mechanism.  For example,
+#   p4 files myfile@\>=3<TAB>
+# will complete a change number.  The valid syntax where the second
+# change or revision in a range does not have the @ or # in front
+# (for example `file@32183,32185') is not currently handled; the @
+# must be repeated.
+#
 # File completion for some functions is restricted by the Perforce
 # status of the file; for example, `p4 opened' only completes opened
 # files (surprised?)  However, you can set the style (N.B. not tag)
@@ -530,7 +541,7 @@ _perforce_changes() {
       # in case we are looking at a range.
       (-tf)
       file=${${(Q)PREFIX}%%[\#@]*}
-      compset -P '*@'
+      compset -P '*@(|\\\<|\\\>)(|=)'
       ;;
 
       # Changes already submitted
@@ -1236,9 +1247,9 @@ _perforce_revisions() {
 	shift
   fi
 
-  # Beware of @foo,#bar; stupid but probably valid.
+  # Beware of @foo,#bar; stupid but valid.
   pfx=${${(Q)PREFIX}%%[\#@]*}
-  compset -P '*\#'
+  compset -P '*\#(|\\\<|\\\>)(|=)'
 
   # Numerical revision numbers, possibly with text.
   if [[ -z $PREFIX || $PREFIX = <-> ]]; then