summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--Completion/Debian/Command/_debchange80
-rw-r--r--Config/version.mk4
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git3
-rw-r--r--Src/params.c35
5 files changed, 112 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index b582ea832..45945d254 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2015-11-30 Daniel Shahaf <d.s@daniel.shahaf.name>
+
+ * 37256: Completion/Debian/Command/_debchange: _debchange
+ (_dch): Update completion.
+
+ * 37252: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
+ vcs_info git: Compute %b correctly with "rebase --onto" of
+ detached heads. (Follow-up to 36725.)
+
+ * 37254: Src/params.c: No functional change: change code layout
+ in preparation for 37253.
+
+ * 37250: Src/params.c: No functional change: rename local
+ variables.
+
2015-11-29 Peter Stephenson <p.w.stephenson@ntlworld.com>
* unposted; Config/version.mk: 5.1.1-test-3.
diff --git a/Completion/Debian/Command/_debchange b/Completion/Debian/Command/_debchange
index 960194ce7..84f364d44 100644
--- a/Completion/Debian/Command/_debchange
+++ b/Completion/Debian/Command/_debchange
@@ -1,10 +1,78 @@
#compdef debchange dch=debchange
-_arguments \
+# Based on dch from devscripts-2.15.3
+
+# At most one of -a/-e/-i/-r/-v may be specified.
+# TODO: specifying --release in the exclusion lists makes -i/-a/-v/-e exclude --release-heuristic, although they shouldn't.
+# TODO: --news' optional argument isn't completed
+# TODO: support --noconf/--no-conf
+
+# List taken from error message: "Only one of ... is allowed; try dch --help for more info"
+local -a mutex=(
+ -a --append
+ -i --increment
+ -e --edit
+ -r --release
+ -v --newversion
+ -d --fromdirname
+ -n --nmu
+ --bin-nmu
+ -q --qa
+ -R --rebuild
+ -s --security
+ --team
+ --bpo
+ -l --local
+)
+
+_arguments -S -s -A "-*" \
'(-h --help)'{-h,--help}'[display help information]' \
- '--version' \
- '(--append -a --newversion -v --increment -i)'{-i,--increment}'[increment release or version number]' \
- '(--append -a --newversion -v --increment -i)'{-a,--append}'[add new changelog entry]' \
- '(--append -a --newversion -v --increment -i)'{-v,--newversion}'[specify new version number]:version:' \
- '(--preserve -p)'{-p,--preserve}'[preserve source tree directory name]' \
+ --version'' \
+ "($mutex)"{-i,--increment}'[increment release or version number]' \
+ "($mutex)"{-a,--append}'[add new changelog entry]' \
+ "($mutex)"{-v+,--newversion=}'[specify new version number]:version:' \
+ "($mutex)"{-e,--edit}'[edit changelog in an editor]' \
+ "($mutex)"{-r,--release}'[finalize changelog for a release]' \
+ '(--no-force-save-on-release)'--force-save-on-release'[with --release, require changelog to be saved when previewed (default)]' \
+ '(--force-save-on-release)'--no-force-save-on-release'[with --release, do not require changelog to be saved when previewed]' \
+ --create'[create a new debian/changelog (or NEWS) file]' \
+ --empty'[with --create, do not add an "Initial release." entry]' \
+ --package='[specify package name to use in new changelog or new entry]:package name:_deb_packages avail' \
+ "($mutex)"{-n,--nmu}'[increment release number for a non-maintainer upload (NMU)]' \
+ "($mutex)"--bin-nmu'[increment release number for a binary non-maintainer upload (binNMU)]' \
+ "($mutex)"{-q,--qa}'[increment release number for a quality assurance upload (QA)]' \
+ "($mutex)"{-R,--rebuild}'[increment release number for a no-change upload (a rebuild)]' \
+ "($mutex)"{-s,--security}'[increment release number for a security team upload]' \
+ "($mutex)"--team'[increment release number for a team upload]' \
+ "($mutex)"{-U,--upstream}'[increment release number for a parent-distro upload (on a derived distro)]' \
+ "($mutex)"--bpo'[increment release number for a ${suite}-backports upload]' \
+ "($mutex)"{-l+,--local=}'[add suffix to version number (for local builds)]:version number suffix' \
+ '(-b --force-bad-version)'{-b,--force-bad-version}'[force version number to be less than the current one]' \
+ --allow-lower-version='[allow version number lower than current one if the former matches ARG]:pattern to match version numbers that may be lower than current one' \
+ --force-distribution'[accept unrecognized distribution name]' \
+ '(--no-auto-nmu)'--auto-nmu'[automatically detect NMUs (default)]' \
+ '(--auto-nmu)'--no-auto-nmu'[do not automatically detect NMUs]' \
+ "($mutex)"{-d,--fromdirname}'[derive upstream version number from basename of current working directory]' \
+ --closes='[specify bug numbers to close]:bug numbers to close (comma-separated)' \
+ --query'[with --closes, contact the BTS (default)]' \
+ --noquery'[with --closes, contact the BTS (default)]' \
+ '(--no-preserve --nopreserve --preserve -p)'{-p,--preserve}'[preserve source tree directory name]' \
+ '(--preserve -p)'{--no-preserve,--nopreserve}'[do not preserve source tree directory name (default)]' \
+ --vendor='[override distributor ID (default\: see dpkg-vendor)]:vendor name' \
+ '(-D --distribution)'{-D+,--distribution=}'[specify distribution name for entry (default: value of top entry)]:distribution name' \
+ '(-u --urgency)'{-u+,--urgency=}'[specify urgency for entry (default\: value of top entry)]:urgency' \
+ '(-c --changelog)'{-c+,--changelog=}'[specify changelog filename]:changelog filename:_files' \
+ --news'[edit NEWS instead of changelog (optional argument\: filename)]' \
+ '(--nomultimaint)'--multimaint'[indicate multiple authors (default)]' \
+ '(--multimaint)'--nomultimaint'[do not indicate multiple authors]' \
+ '(--nomultimaint-merge)'--multimaint-merge'[merge changes by a the same author]' \
+ '(--multimaint-merge)'--nomultimaint-merge'[do not merge changes by a the same author (default)]' \
+ '(-m --maintmaint)'{-m,--maintmaint}'[do not modify maintainer details]' \
+ '(-M --controlmaint)'{-M,--controlmaint}'[use maintainer details from debian/control]' \
+ '(--nomainttrailer)'{-t,--mainttrailer}'[do not modify changelog trailer line unless required]' \
+ '(--mainttrailer -t)'--nomainttrailer'[modify changelog trailer line normally]' \
+ --check-dirname-level':when to check the parent directory'\''s name:((0\:never 1\:"if different from current working directory" 2\:always))' \
+ --check-dirname-regex'[regex to match base directory'\''s name]:anchored perl regular expression (default\: '\''PACKAGE(-.+)?'\'')' \
+ --release-heuristic'[control "package has been released" heuristic]:heuristic:((changelog\:"via changelog \"UNRELEASED\" distribution (default)" log\:"ia upload logfile in parent directory"))' \
':text:'
+ # multimaint
diff --git a/Config/version.mk b/Config/version.mk
index 6205a6f77..64c7b6b39 100644
--- a/Config/version.mk
+++ b/Config/version.mk
@@ -27,5 +27,5 @@
# This must also serve as a shell script, so do not add spaces around the
# `=' signs.
-VERSION=5.1.1-test-3
-VERSION_DATE='November 29, 2015'
+VERSION=5.2
+VERSION_DATE='December 2, 2015'
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 704c1890e..e1cee7439 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -87,7 +87,8 @@ VCS_INFO_git_getbranch () {
gitbranch="$(${(z)gitsymref} 2> /dev/null)"
[[ -z ${gitbranch} ]] && [[ -r ${actiondir}/head-name ]] \
&& gitbranch="$(< ${actiondir}/head-name)"
- [[ -z ${gitbranch} ]] && gitbranch="$(< ${gitdir}/ORIG_HEAD)"
+ [[ -z ${gitbranch} || ${gitbranch} == 'detached HEAD' ]] \
+ && gitbranch="$(< ${gitdir}/ORIG_HEAD)"
elif [[ -f "${gitdir}/MERGE_HEAD" ]] ; then
gitbranch="$(${(z)gitsymref} 2> /dev/null)"
diff --git a/Src/params.c b/Src/params.c
index 4600284f0..d8bf83d0e 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -2537,6 +2537,7 @@ setarrvalue(Value v, char **val)
freearray(val);
return;
}
+
if (v->start == 0 && v->end == -1) {
if (PM_TYPE(v->pm->node.flags) == PM_HASHED)
arrhashsetfn(v->pm, val, 0);
@@ -2545,47 +2546,49 @@ setarrvalue(Value v, char **val)
} else if (v->start == -1 && v->end == 0 &&
PM_TYPE(v->pm->node.flags) == PM_HASHED) {
arrhashsetfn(v->pm, val, 1);
+ } else if ((PM_TYPE(v->pm->node.flags) == PM_HASHED)) {
+ freearray(val);
+ zerr("%s: attempt to set slice of associative array",
+ v->pm->node.nam);
+ return;
} else {
char **old, **new, **p, **q, **r;
- int n, ll, i;
+ int pre_assignment_length;
+ int post_assignment_length;
+ int i;
- if ((PM_TYPE(v->pm->node.flags) == PM_HASHED)) {
- freearray(val);
- zerr("%s: attempt to set slice of associative array",
- v->pm->node.nam);
- return;
- }
if ((v->flags & VALFLAG_INV) && unset(KSHARRAYS)) {
if (v->start > 0)
v->start--;
v->end--;
}
q = old = v->pm->gsu.a->getfn(v->pm);
- n = arrlen(old);
+ pre_assignment_length = arrlen(old);
if (v->start < 0) {
- v->start += n;
+ v->start += pre_assignment_length;
if (v->start < 0)
v->start = 0;
}
if (v->end < 0) {
- v->end += n + 1;
+ v->end += pre_assignment_length + 1;
if (v->end < 0)
v->end = 0;
}
if (v->end < v->start)
v->end = v->start;
- ll = v->start + arrlen(val);
- if (v->end <= n)
- ll += n - v->end + 1;
+ post_assignment_length = v->start + arrlen(val);
+ if (v->end <= pre_assignment_length)
+ post_assignment_length += pre_assignment_length - v->end + 1;
- p = new = (char **) zshcalloc(sizeof(char *) * (ll + 1));
+ p = new = (char **) zshcalloc(sizeof(char *)
+ * (post_assignment_length + 1));
for (i = 0; i < v->start; i++)
- *p++ = i < n ? ztrdup(*q++) : ztrdup("");
+ *p++ = i < pre_assignment_length ? ztrdup(*q++) : ztrdup("");
for (r = val; *r;)
*p++ = ztrdup(*r++);
- if (v->end < n)
+ if (v->end < pre_assignment_length)
for (q = old + v->end; *q;)
*p++ = ztrdup(*q++);
*p = NULL;