* vcs_info for mercurial doesn't detect shared repos
@ 2014-01-16 1:59 Benjamin Peterson
2014-01-16 9:14 ` Frank Terbeck
0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Peterson @ 2014-01-16 1:59 UTC (permalink / raw)
To: zsh-workers
Hi,
The hg share extension [1] lets you have multiple working trees with
with the same backing repository. It seems vcs_info fails to detect
working copies where the share extension is used because those .hg dirs
don't contain "store" or "data" subdirectories as the VCS detection
requires. It think it would be safer to look for the "hgrc" or "branch"
file.
[1] http://mercurial.selenic.com/wiki/ShareExtension
--
Regards,
Benjamin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: vcs_info for mercurial doesn't detect shared repos
2014-01-16 1:59 vcs_info for mercurial doesn't detect shared repos Benjamin Peterson
@ 2014-01-16 9:14 ` Frank Terbeck
2014-01-16 14:41 ` Benjamin Peterson
0 siblings, 1 reply; 7+ messages in thread
From: Frank Terbeck @ 2014-01-16 9:14 UTC (permalink / raw)
To: Benjamin Peterson; +Cc: zsh-workers
Benjamin Peterson wrote:
> Hi,
Hey!
> The hg share extension [1] lets you have multiple working trees with
> with the same backing repository. It seems vcs_info fails to detect
> working copies where the share extension is used because those .hg dirs
> don't contain "store" or "data" subdirectories as the VCS detection
> requires. It think it would be safer to look for the "hgrc" or "branch"
> file.
We used to use ‘branch’ as the file to check for but moved away from it,
because it didn't work reliably with newer versions of mercurial (this
might have changed again in the meantime, since I don't follow
mercurial's development too closely).
Checking for ‘hgrc’ is not an option, because ~/.hg/hgrc is a possible
configuration file location, which would lead to false positives in the
user's home directory.
If a mercurial developer has an idea on how to properly detect this
particular extension, I'd be all ears. ;)
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: vcs_info for mercurial doesn't detect shared repos
2014-01-16 9:14 ` Frank Terbeck
@ 2014-01-16 14:41 ` Benjamin Peterson
2014-01-16 15:05 ` [PATCH] vcs_info, hg: Support detecting repos using ShareExtension Frank Terbeck
0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Peterson @ 2014-01-16 14:41 UTC (permalink / raw)
To: Frank Terbeck; +Cc: zsh-workers
On Thu, Jan 16, 2014, at 01:14 AM, Frank Terbeck wrote:
> We used to use ‘branch’ as the file to check for but moved away from it,
> because it didn't work reliably with newer versions of mercurial (this
> might have changed again in the meantime, since I don't follow
> mercurial's development too closely).
>
> Checking for ‘hgrc’ is not an option, because ~/.hg/hgrc is a possible
> configuration file location, which would lead to false positives in the
> user's home directory.
I see. Tricky!
>
> If a mercurial developer has an idea on how to properly detect this
> particular extension, I'd be all ears. ;)
shared repos have a file .hg/sharedpath if that helps
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] vcs_info, hg: Support detecting repos using ShareExtension
2014-01-16 14:41 ` Benjamin Peterson
@ 2014-01-16 15:05 ` Frank Terbeck
2014-01-17 5:48 ` Benjamin Peterson
0 siblings, 1 reply; 7+ messages in thread
From: Frank Terbeck @ 2014-01-16 15:05 UTC (permalink / raw)
To: zsh-workers; +Cc: Benjamin Peterson
---
Benjamin Peterson wrote:
> shared repos have a file .hg/sharedpath if that helps
If that's indeed the case, the following should make backend detect such
repositories. I don't know if supporting this requires changes to the _get_data
function as well. Would be good if someone could test this before I push the
patch to the repo...
Regards, Frank
Functions/VCS_Info/Backends/VCS_INFO_detect_hg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_hg b/Functions/VCS_Info/Backends/VCS_INFO_detect_hg
index a22c1ee..d7b1d0d 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_detect_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_hg
@@ -7,7 +7,7 @@ setopt localoptions NO_shwordsplit
[[ $1 == '--flavours' ]] && { print -l hg-git hg-hgsubversion hg-hgsvn; return 0 }
VCS_INFO_check_com ${vcs_comm[cmd]} || return 1
-vcs_comm[detect_need_file]="store data"
+vcs_comm[detect_need_file]="store data sharedpath"
VCS_INFO_bydir_detect '.hg' || return 1
if [[ -d ${vcs_comm[basedir]}/.hg/svn ]] ; then
--
1.8.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] vcs_info, hg: Support detecting repos using ShareExtension
2014-01-16 15:05 ` [PATCH] vcs_info, hg: Support detecting repos using ShareExtension Frank Terbeck
@ 2014-01-17 5:48 ` Benjamin Peterson
2014-01-17 8:01 ` Frank Terbeck
0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Peterson @ 2014-01-17 5:48 UTC (permalink / raw)
To: Frank Terbeck, zsh-workers
On Thu, Jan 16, 2014, at 07:05 AM, Frank Terbeck wrote:
> ---
>
> Benjamin Peterson wrote:
> > shared repos have a file .hg/sharedpath if that helps
>
> If that's indeed the case, the following should make backend detect such
> repositories. I don't know if supporting this requires changes to the
> _get_data
> function as well. Would be good if someone could test this before I push
> the
> patch to the repo...
Works well for me. Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] vcs_info, hg: Support detecting repos using ShareExtension
2014-01-17 5:48 ` Benjamin Peterson
@ 2014-01-17 8:01 ` Frank Terbeck
0 siblings, 0 replies; 7+ messages in thread
From: Frank Terbeck @ 2014-01-17 8:01 UTC (permalink / raw)
To: Benjamin Peterson; +Cc: zsh-workers
Benjamin Peterson wrote:
> On Thu, Jan 16, 2014, at 07:05 AM, Frank Terbeck wrote:
>> [...] Would be good if someone could test this before I push the
>> patch to the repo...
>
> Works well for me. Thanks!
I've just pushed the change to the central repository.
Thanks for reporting, suggesting a fix and testing! :-)
Regards, Frank
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: vcs_info for mercurial doesn't detect shared repos
@ 2014-01-16 14:43 Benjamin Peterson
0 siblings, 0 replies; 7+ messages in thread
From: Benjamin Peterson @ 2014-01-16 14:43 UTC (permalink / raw)
To: Frank Terbeck; +Cc: zsh-workers
On Thu, Jan 16, 2014, at 01:14 AM, Frank Terbeck wrote:
> We used to use ‘branch’ as the file to check for but moved away from it,
> because it didn't work reliably with newer versions of mercurial (this
> might have changed again in the meantime, since I don't follow
> mercurial's development too closely).
>
> Checking for ‘hgrc’ is not an option, because ~/.hg/hgrc is a possible
> configuration file location, which would lead to false positives in the
> user's home directory.
I see. Tricky!
>
> If a mercurial developer has an idea on how to properly detect this
> particular extension, I'd be all ears. ;)
shared repos have a file .hg/sharedpath if that helps
--
Regards,
Benjamin
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-01-17 8:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-16 1:59 vcs_info for mercurial doesn't detect shared repos Benjamin Peterson
2014-01-16 9:14 ` Frank Terbeck
2014-01-16 14:41 ` Benjamin Peterson
2014-01-16 15:05 ` [PATCH] vcs_info, hg: Support detecting repos using ShareExtension Frank Terbeck
2014-01-17 5:48 ` Benjamin Peterson
2014-01-17 8:01 ` Frank Terbeck
2014-01-16 14:43 vcs_info for mercurial doesn't detect shared repos Benjamin Peterson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).