rebase conflicts
* zshrc: Make vcs_info() detect $GIT_DIR/svn and set the name of the
vcs to 'git-svn'
+ * zshrc: Handle .hg subdirectories, that are not the .hg subdirectory
+ of a mercurial repository. Found by Karl Voit.
- -- Frank Terbeck <ft@grml.org> Wed, 27 Aug 2008 22:35:09 +0200
+ -- Frank Terbeck <ft@grml.org> Fri, 29 Aug 2008 19:08:28 +0200
grml-etc-core (0.3.52) unstable; urgency=low
# }}}
VCS_INFO_realpath () { #{{{
# replacing 'readlink -f', which is really not portable.
+
+ # If there *is* a chpwd() function unfunction it here.
+ # The *real* zsh does not loose its chpwd(), because we run
+ # in a different context (process substitution in $PROMPT).
(( ${+functions[chpwd]} )) && unfunction chpwd
setopt chaselinks
cd $1 2>/dev/null && pwd
VCS_INFO_detect_by_dir() {
local dirname=${1}
- local basedir="."
+ local basedir="." realbasedir
+
+ realbasedir=$(VCS_INFO_realpath ${basedir})
+ while [[ ${realbasedir} != '/' ]]; do
+ if [[ -n ${vcs_comm[detect_need_file]} ]] ; then
+ [[ -d ${basedir}/${dirname} ]] && \
+ [[ -f ${basedir}/${dirname}/${vcs_comm[detect_need_file]} ]] && \
+ break
+ else
+ [[ -d ${basedir}/${dirname} ]] && break
+ fi
- while [[ ! -d ${basedir}/${dirname} ]]; do
basedir=${basedir}/..
- [[ $(VCS_INFO_realpath ${basedir}) = "/" ]] && return 1
+ realbasedir=$(VCS_INFO_realpath ${basedir})
done
- vcs_comm[basedir]=${basedir}
+ [[ ${realbasedir} == "/" ]] && return 1
+ vcs_comm[basedir]=${realbasedir}
return 0
}
VCS_INFO_hg_detect() {
check_com -c hg || return 1
+ vcs_comm[detect_need_file]=branch
VCS_INFO_detect_by_dir '.hg'
return $?
}