Closed (fixed)
Project:
Version Control API
Version:
6.x-2.x-dev
Component:
API module
Priority:
Major
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
16 Jun 2010 at 12:05 UTC
Updated:
3 Jan 2014 at 01:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tizzo commentedThe question is whether this should be handled by vcsapi or left to the backend. The semaphore api is pretty easy to use and all we really need to do is call lock_acquire('versioncontrol_[name of repository]') and lock_release('versioncontrol_[name of repository]') so it could go in either place.
Where does everyone think it makes the most sense?
Comment #2
marvil07 commentedmoving to vcs api, see the related #945130: Update versioncontrol_repositories table to have update method and updated columns.
Comment #3
tizzo commentedSam and I discussed this in IRC today. The current plan is to add wrapper methods to the VersionControlRepository object that acquire and clear locks using the semaphore api. That way we don't have to rely on magic naming and reimplementing things the same way in different backends.
Planning to hit this up in the next 24 hours.
Comment #4
tizzo commentedHere's a first crack...
Comment #5
tizzo commentedComment #6
marvil07 commentedPlease note that there are two classes on that file, and you want to move the code to VersioncontrolRepository instead of using VersioncontrolRepositoryUrlHandler
Powered by Dreditor.
Comment #7
tizzo commentedSorry about that, sloppy patch.
This is set and I have tested it. I think it's working. Now we just need to use it elsewhere.
Comment #8
tizzo commentedComment #9
marvil07 commentedAs we have used locked _only_ from backends, not at versioncontrol module, we do not really have a use case here. But we do have it at backends, maybe the better is to move the "automatic retrieval" to the versioncontrol module, and let backends use it, and we can handle then the locks here.
Tagging and changing the priority since this is now mainly broken for backends(git) that are assuming a
VersioncontrolRepository->lockeddata member exists.For now, a minor update:
lock_release() do not receive a second parameter.
And update a comment ;-)
Powered by Dreditor.
Comment #10
marvil07 commentedSomething almost-related: #484376: Use the batch API for the Fetch Now link (if we decide to move "automatic retrieval" to the main versioncontrol module)
Comment #11
sdboyer commentedConceptually, I like the idea of having a VersioncontrolRepository::fetchUpdate() or something - a single method that all backends need to implement which trips off the manual retrieval process. If we do that, then we might use the parent implementation to handle the lock acquiring...maybe.
Comment #12
tizzo commentedThis needs more thought and restructuring.
Comment #13
marvil07 commentedre-add lock as column for repo table instead of using data field.
Comment #14
marvil07 commentedmissing data member, now is there
Comment #15
marvil07 commentedhttp://drupal.org/cvs?commit=449672