Rearrange vcs detection a bit to use the first vcs found up the tree
rather than the first VCS we find somewhere up the tree. This will
keep us from stumbling over "false" git repos higher in the tree.
Also fix hg directory specification, it was broken before.
Details
I guess try it with each case we support...
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 6369 Build 6607: arc lint + arc unit
Event Timeline
it appears this is based on a slightly older version of newvers.sh
sys/conf/newvers.sh | ||
---|---|---|
69 | svn should probably be first, since it's canonical and if you have both a .svn/ and .git/ svn should take precedence (I think) |
sys/conf/newvers.sh | ||
---|---|---|
277 | I can see this might be clearer not moving to the top, though modified= needs to be up there. |
sys/conf/newvers.sh | ||
---|---|---|
76 | I suppose here you could do something like if [ -n "${P4CLIENT} ]; then VCS=p4 return 0 fi i.e., if we didn't find a vcs dir at the first iteration and there's a perforce client env var, assume that we're using perforce |
sys/conf/newvers.sh | ||
---|---|---|
293–294 | sense here is backwards: if the src is not modified, we don't want to include the metadata |
sys/conf/newvers.sh | ||
---|---|---|
69 | For that matter, a comment clarifying that would be good too. |
I think this idea is good - we should look for any vcs at the src topdir first, followed by any vcs at ../, etc. $topdir/../.git should not take precedence over $topdir/.svn e.g.
There have been a number of newvers.sh changes though and this will need a fairly extensive rebase.
It doesn't help I started with a stale version...
I'll try to rebase, but the last time it was more extensive than I had bandwidth for that day.
Clearly I didn't get to this either, and everyone consolidating on git likely makes this much less important.