Page MenuHomeFreeBSD

Rearrange vcs detection.
Needs RevisionPublic

Authored by imp on Dec 23 2016, 7:30 PM.



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.

Test Plan

I guess try it with each case we support...

Diff Detail

Lint OK
No Unit Test Coverage
Build Status
Buildable 6370
Build 6608: arc lint + arc unit

Event Timeline

imp updated this revision to Diff 23222.Dec 23 2016, 7:30 PM
imp retitled this revision from to Rearrange vcs detection..
imp updated this object.
imp edited the test plan for this revision. (Show Details)
imp edited the test plan for this revision. (Show Details)Dec 23 2016, 7:32 PM
imp added reviewers: emaste, jhb, glebius.
emaste edited edge metadata.Dec 23 2016, 7:53 PM

it appears this is based on a slightly older version of


svn should probably be first, since it's canonical and if you have both a .svn/ and .git/ svn should take precedence (I think)

imp updated this revision to Diff 23227.Dec 23 2016, 10:29 PM
imp edited the test plan for this revision. (Show Details)
imp edited edge metadata.

Update to latest (hopefully w/o losing anything)

imp added inline comments.Dec 23 2016, 10:31 PM

I can see this might be clearer not moving to the top, though modified= needs to be up there.

emaste added inline comments.Dec 23 2016, 10:45 PM

I suppose here you could do something like

if [ -n "${P4CLIENT} ]; then
        return 0

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

imp updated this revision to Diff 23228.Dec 23 2016, 10:52 PM

Update for p4

emaste requested changes to this revision.Dec 24 2016, 2:22 AM
emaste edited edge metadata.
emaste added inline comments.

sense here is backwards: if the src is not modified, we don't want to include the metadata

This revision now requires changes to proceed.Dec 24 2016, 2:22 AM
rpokala added inline comments.

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 changes though and this will need a fairly extensive rebase.

imp added a comment.Oct 13 2017, 9:05 PM

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.

emaste added a comment.Dec 5 2017, 8:08 PM

@imp do you think you might look at this again soon? I may pick it up if you won't.

imp added a comment.Dec 5 2017, 9:05 PM

Feel free to pick this up... It's so far down on my list...