Is there any way to view log for when file was locked in TortoiseSVN?
Subversion doesn't store lock history.
In Apache Subversion there are things called hooks; They are similar to triggers in SQL and perform their task after and before you perform a Subversion action on a server.
You need to take a look at the pre-lock and post-lock hook script templates which allows you to write a script to store lock history in a log file or send lock / unlock e-mail notifications.
If that template is not available in your repository you can download it from http://plugins-svn.bbpress.org/smiley-choice/hooks/pre-lock.tmpl and use it as a sample.
Remember you need to modify above template to meed your needs but this will surely help and work for you.
Please look at How do I create a SVN Commit Message Template and Hook to Verify also.
Related
We have 30 User's and 26 of them are Artists, and all of their workspaces were created manually with their username and a project alias. Now we want to add some new view's to the user's workspace, is there a way to do a bulk-edit on that with a perforce command?
Can I, as an admin modify a workspaces view and that would be reflected, next time the Artist opens up perforce?
Perforce's built-in solution for this is called streams.
With a "stream-based" workflow, each project (and each codeline for each project, if applicable) is defined by a "stream" specification that defines which paths the project contains, and its relation to other streams, if any.
When a workspace is associated with a stream, the view is automatically generated based on the stream specification, and modifications to the stream specification are automatically propagated to all workspaces associated with that stream.
With a "classic" client specification, each workspace has its own independently created view, which is not tied to any other workspace or any other object. As an admin you can modify an other user's client spec via the p4 client -f command, and you could potentially script this command to automate that modification across multiple client specs.
However, I'd recommend looking at streams as an easier solution; it might be a bit of work up front to migrate from manual views to stream views, but if you anticipate the need to make changes like this frequently, using streams will be quite a bit easier than maintaining your own tooling.
I a writing a little webapp, which allows the users to browse through a Visual SVN server. I would like to add an online editor like github in this webapp, so users can edit the files online, leave a message and the changes appear in the repository.
For that I need to checkout the files locally. My idea was to check them in a mongodb out, so I can save the changes per user like a local working copy.
Is there a way (without reimplementing the svn protocol) to make a checkout in a database or even just the memory and then write it in the database.
If there are any questions, just ask :)
Btw. if someone is interested, here is the code https://bitbucket.org/Knerd/svn-browser
There is no way to do svn checkout to directly to database. But there is some options.
First of all, you can simple create virtual disk that resides in memory and perform checkouts to that disk. Than you can store checked out files to database.
Another option is to use rich Subversion API directly. Note, that Subversion is written in C, so you will need to build bridge between Node.js and SVN (as far as I can remember, there is no official Subversion bindings for Node.js, but there is for Python and Java and there is unofficial nodesvn package available for Node.js). Using the API you can implement your own 'in-database' working copy.
Also you can use svnmucc utility (which is shipped with VisualSVN Server) to make commits directly in the repository (without even making a working copy). If you combine it with svn ls, svn info etc. you can implement repository browsing and editing of files.
We are using perforce as a source control for Visual studio solution.
Working with P4 and P4V.
Is it possible to add client side pre-commit hook? for instance to ensure the word "debugger;" is not exist in *.js files.
Could find something in Google.
Thanks.
Perforce triggers can be used to enforce such a policy, but they run in the server, not client-side. So most sites that I'm aware of would enforce a rule such as the one you describe using a change-content trigger in the server.
http://www.perforce.com/perforce/doc.current/manuals/cmdref/triggers.html
It's not obvious from your question why you need to have a client-side hook. Is there some reason you don't want to use a change-content trigger?
Perhaps you might consider re-framing your workflow as a code review process, and implement policies like this in your code review tool of choice.
One approach that you could use is a "Custom Tool":
https://www.perforce.com/perforce/doc.current/manuals/p4v/custom_tools.html
Basically you would write a script that takes the changelist as an arg checks your condition on every file in your changelist and calls p4 commit if it succeeds.
Use latest git-p4. My patch for the hook p4-pre-submit is merged into Git's next branch.
The hook is a simple executable script which will stop the submit process to start up if the script exist with non-zero status. So p4-pre-submit hook is pretty safe without any side effect.
See https://github.com/git/git/blob/next/Documentation/git-p4.txt for details.
Please note git-p4 is an independent python script. It's not dependent on any specific version of git. So you can upgrade git-p4 only.
The hook p4-pre-submit has no other interaction with git/git-p4 except exiting status. So you can write the hook in any language (I recommend python).
Here is sample .git/hooks/p4-pre-submit:
#!/bin/sh
cd $GIT_DIR && make test
A remote CMIS repository contains many folders/files.
I am writing a software that keeps a local copy of these folders/files in sync.
At first run I just download everything recursively.
At later runs, I check what has changed, and download any changes.
What is the most efficient way to check the remote changes?
(additional/removal of files/folders)
Most efficient = Least bandwidth usage.
I can only use the CMIS protocol, and I can not run any custom software on the remote server.
My ideas so far:
Idea 1: Re-download everthing every time.
Idea 2: Check the root folder's modification date, hoping modification dates are recursive.
Idea 3: Use CMIS search to find all files that are more recent than the last time I synchronized. Problem: that won't tell me which files have been removed.
Any other ideas?
I don't know the CMIS protocol much, there might be something more convenient.
Using the repository's change log is the right way to go, but realize that not every repository supports this. For example, for Alfresco you must configure the audit sub-system and you must set audit.cmischangelog.enabled=true in alfresco-global.properties.
To find out if your repo supports changes you can look as the results of the repository's getCapabilities response. If you see 'Changes' set to 'None' then your repository doesn't support change logs.
Assuming it does, you need to ask the repository for its latest change log token. You can get that from getRepositoryInfo. Save that before you call getContentChanges. Then, on the next call, pass in the token. You'll get the changes made since the token was issued.
So, your code needs to:
Check getCapabilities for something other than Changes = None
Save the getRepositoryInfo's latestChangeLogToken
The first time you ask, call getContentChanges with no arguments
The next time you ask, call getcontentChanges with the last saved token
You can then process the result set. Each change log entry tells you its type (created, updated, deleted, permissions, etc., see spec for exact values) and provides the cmis:objectId of the changed object.
Repeat with step 2.
I have a "cmis-sync" script that does one-way synchronization using this approach implemented in Python. I've tested it against Alfresco as the source and the OpenCMIS InMemory repository as the target. If there is interest I can make it available.
A more ideal version of idea 3 is easily accomplished according to some digging through the CMIS protocol you posted.
2.1.11 Change Log
CMIS provides a “change log” mechanism to allow applications to easily discover the set of changes that have occurred to objects stored in the repository since a previous point in time. This change log can then be used by applications such as search services that maintain an external index of the repository to efficiently determine how to synchronize their index to the current state of the repository (rather than having to query for all objects currently in the repository).
Entries recorded in the change log are referred to below as “change events”.
Note that change events in the change log MUST be returned in ascending order from the time when the change event occurred.
Using whatever tools of your choice, you should be able to do an initial pull of the entire repository and save the time the pull was performed. Subsequent queries to the repository (at an interval of your choosing) are done with the following procedure:
Pull down the CMIS changelog from the repository
Parse all changes created after the previous pulls
Perform operations based on the ChangeType enum: for example, if the "deleted" enum is present for an objectID, delete that object locally.
C:\Program Files\TortoiseSVN\bin
/command:commit /path:******\trunk\dotnet /notempfile /closeonend
1000
the code above pops up a window asking for "entering a message, selecting the changed content and then clicking OK and again clicking OK again after the process completes"
I would be extremely thankful if anyone can suggest how to avoid the above said process if commit is done using cruise control (config file).
thanks.
pratap
It's not CruiseControl that does the commit - it's just calling TortoiseSVN to trigger a GUI wrapper over a Subversion action. So to execute the commit as a silent activity (i.e. with no GUI) you simply need to replace the invocation of TortoiseSVN with a call to 'svn commit' and provide the appropriate parameters.
Svn help here.
If you are automating SVN actions, you should be using a command-line client, not TortoiseSVN. Hit that link to download a client, and see the SVN documentation as well.
From the documentation on tortoiseproc.exe here.
"You can also specify the /logmsg
switch to pass a predefined log
message to the commit dialog."
you may also want to append your /closeonend to be /closeonend:1 to prevent the extra confirmation click step. The switch values are also described on the documentation page.
I do not use crusecontrol but I do this sucesfully from a command file that I use to commit and publish my asp.net site.