Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: vcs_info Mercurial backend branch name display
- X-seq: zsh-workers 27970
- From: Seth House <seth@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PATCH: vcs_info Mercurial backend branch name display
- Date: Mon, 24 May 2010 17:55:35 +0000 (UTC)
- Connect(): No such file or directory
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <loom.20100524T173939-572@xxxxxxxxxxxxxx> <m3iq6d2qqz.fsf@xxxxxxxxxxxxxx>
Greg Klanderman <gak <at> klanderman.net> writes:
> Looks like you have a spurious 'if' there..
No, that is correct. It initially tries to obtain the branch name by
invoking hg (line 54) -- only if the user has opted to allow invoking
hg. If it still doesn't know the branch name and a file containing the
name is readable, it will pull it from the file (line 59). Finally, if
we still don't know the branch it defaults to "default" (line 64).
It could be refactored to the following if you feel this is more
readable:
# If the user doesn't opt to invoke hg we can still get the current branch
if [[ -z ${r_branch} ]] ; then
if [[ -r ${branchfile} ]] ; then
r_branch=$(< ${branchfile})
else
# If we still don't know the branch it's safe to assume default
r_branch="default"
fi
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author