Fix key lookup when a repo is found, but the file under edit isn't a part of it.
1 files changed, 5 insertions(+), 3 deletions(-)

M plugin/hgrev.vim
M plugin/hgrev.vim +5 -3
@@ 100,11 100,13 @@ function! <SID>RefreshMercurialRev()
 	let l:rev     = system( l:cmd )
 	let l:hg_exit = v:shell_error
 
-	if l:hg_exit == 0
-		let l:rev = substitute( l:rev, '\n', '', 'g' )
-		let g:hg_revs[ l:key ] = l:rev
+	if l:hg_exit != 0
+		return
 	endif
 
+	let l:rev = substitute( l:rev, '\n', '', 'g' )
+	let g:hg_revs[ l:key ] = l:rev
+
 	" Add file repo status.
 	"
 	if g:hgrevAddStatus == 1