From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27482 invoked by alias); 25 May 2014 22:02:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32619 Received: (qmail 2581 invoked from network); 25 May 2014 22:02:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:subject:message-id :mime-version:content-type; s=mesmtp; bh=vZzRyjMBjKq44hjKcoinfK4 zYmM=; b=cITgVljsT39GETyvgLuI9SdCD9k/rQPCdY7B5AfDAE+4oJby2MsT7m4 0sdN+JIyxx3k71QZVEpFxxQrRiwvyZRolv5PhmkQ3hIcrUDNa4f5GEptaecVmBo7 FB+fQ2+nZvuRYrR2LQOapnG+5WSpiJxRbWKP4EnQyP8P651jCIq4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:subject:message-id :mime-version:content-type; s=smtpout; bh=vZzRyjMBjKq44hjKcoinfK 4zYmM=; b=cgENsXqgR9pQ/TS3YFzcXaWDubiO85r/blepmmfimNTQ1Jy9Or4Nk6 KWlnhhZPsX+3vJXCcHxL/cH2+kFKuhqn1uIcppGAGkEW0ic+ERcotTv+KC3EyI0A OG785Fm3nMjuw7MeXfKLlfphQEMnqU7yBVGAB61cadEQ46W2kZNms= X-Sasl-enc: CWWKd55qGs+6XgzbC7IRGhv7jIbikRJVvXq/YX+Zre8W 1401054818 Date: Sun, 25 May 2014 21:53:35 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH] vcs_info svn: Use the revision of cwd Message-ID: <20140525215335.GD2726@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Previously, the value of the wc root would be used. In Subversion, it makes more sense to use the revision of cwd, since all commands (e.g., 'svn ci', 'svnversion') operate only on cwd and below, not on wcroot and below. --- This could happen if the working copy is checked out from trunk's parent, or simply if one works on a single module and runs a few updates/commits within that module's directory within the project. Functions/VCS_Info/Backends/VCS_INFO_get_data_svn | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn index 41cc3e7..ae3c499 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn @@ -7,7 +7,7 @@ setopt localoptions noksharrays extendedglob NO_shwordsplit local svnbase svnbranch a b rrn local -i rc -local -A svninfo parentinfo +local -A svninfo parentinfo cwdinfo local -xA hook_com svnbase="."; @@ -28,6 +28,8 @@ done #rc=${pipestatus[1]} #(( rc != 0 )) && return 1 +cwdinfo=(${(kv)svninfo}) + while [[ -d "${svnbase}/../.svn" ]]; do parentinfo=() ${vcs_comm[cmd]} info --non-interactive "${svnbase}/.." | while IFS=: read a b; do parentinfo[${a// /_}]="${b## #}"; done @@ -40,12 +42,12 @@ svnbase="$(VCS_INFO_realpath ${svnbase})" rrn=${svnbase:t} zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" branchformat svnbranch || svnbranch="%b:%r" -hook_com=( branch "${svninfo[URL]##*/}" revision "${svninfo[Revision]}" ) +hook_com=( branch "${svninfo[URL]##*/}" revision "${cwdinfo[Revision]}" ) if VCS_INFO_hook 'set-branch-format' "${svnbranch}"; then zformat -f svnbranch "${svnbranch}" "b:${hook_com[branch]}" "r:${hook_com[revision]}" else svnbranch=${hook_com[branch-replace]} fi hook_com=() -VCS_INFO_formats '' "${svnbranch}" "${svnbase}" '' '' "${svninfo[Revision]}" '' +VCS_INFO_formats '' "${svnbranch}" "${svnbase}" '' '' "${cwdinfo[Revision]}" '' return 0 -- 1.7.10.4