Feature #339
additional SCM support
| Status: | New | Start: | ||
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | SCM | |||
| Target version: | - | |||
| Resolution: |
Description
While everyones priorities are different, being able to support a similar array to Trac would make RedMine much more
attractive.
1) Mercurial
2) Darcs
3) Bzr
History
Updated by Jean-Philippe Lang over 2 years ago
I'm currently working on Mercurial support. It's almost finished
and should be available soon.
Updated by Jean-Philippe Lang over 2 years ago
Basic support for CVS and Mercurial SCMs is added in rev 559.
Browsing, changesets fetching and diff viewing are implemented.
Only tested with local repositories.
Thanks to Ralph Vater for CVS specific code.
Updated by Karim Trott about 1 year ago
I would like to see perforce support as well (of course its not open source..)
Updated by Wassim Hafez 11 months ago
Perforce support is a key factor being considered by our organization while evaluating collaboration tools, are there any plans for supporting Perforce?
Also, in general, what's involved in developing integration between redmine and SCM/third-party tools?
Updated by Thomas Lecavelier 11 months ago
Wassim Hafez wrote:
Two solution to get Redmine talking with a non-free (as free beer) SCM:Also, in general, what's involved in developing integration between redmine and SCM/third-party tools?
- people with legal licence write and maintain the adapter and their tests (quite easy)
- people offer a legal licence to jplang or an contributor, so he can write and maintain the adapter
So, you can contact your lobby :)
Updated by Ollivier Robert 11 months ago
Speaking for perforce which I used for 5 years before moving to Arch then Hg, anyone can obtain a free license for free software usage. The main problem I had during the last two years is that the license is granted for one year and can be renewed but the process got more complicated (I had to send the GPL & BSD licenses by fax!) so I finally gave up. But it is doable.
Updated by Vianney Lecroart 10 months ago
I have a +2 for perforce her. 2 game companies wanted to use redmine, but without perforce, it s a no go for them.
Two solution to get Redmine talking with a non-free (as free beer) SCM:
- people with legal licence write and maintain the adapter and their tests (quite easy)
- people offer a legal licence to jplang or an contributor, so he can write and maintain the adapter
jplang or anybody can play with perforce for free. Of course, it's not opensource and it's evil but lot of companies use it, google, microsoft...
For the licence:
"Perforce Licensing
You can download and use any Perforce software product free. All Perforce software you download is fully functional, with the exception of the Perforce Server, which allows only two users and five client workspaces when used without a license."
"Free Licensing for Open Source Development
Organizations developing software that is licensed or otherwise distributed exclusively under an Open Source license may be eligible to obtain Perforce licenses gratis. This includes upgrades but not support."
So I think it's not a problem to have a perforce licence to test and maintain perforce adapter.
If I knew more ror and p4, i could do it, but it's not the case :'(
Updated by Karim Trott 10 months ago
As Perforce and P4Ruby has been released on rubyforge, does this raise the probalitiy for Perforce SCM support?
Updated by Karl Pietrzak 7 months ago
Karim Trott wrote:
As Perforce and P4Ruby has been released on rubyforge, does this raise the probalitiy for Perforce SCM support?
I think I'd be interested in writing Perforce support, as I have a running installation and we're exploring using Redmine.
Updated by Karim Trott 7 months ago
Karl Pietrzak wrote:
Karim Trott wrote:
As Perforce and P4Ruby has been released on rubyforge, does this raise the probalitiy for Perforce SCM support?
I think I'd be interested in writing Perforce support, as I have a running installation and we're exploring using Redmine.
This sounds good Karl, looking forward on this adapter, tell me when you need additional help.. I'll try to support when I can..
Updated by Jeff Rorison 6 months ago
- File redmine-scm-p4-0.8.0_RC1.zip added
So, I ran into this by accident. Guess I should have been more diligent in searching for it.
I am a Ruby/Rails/Redmine greenie. I have built a Perforce SCM provider for Redmine. I am providing this as a zip as the quickest way to help out. I have never used the svn/cvs patch methods and am loathe to hold or mess it up.
I used the 8.0_RC1 version to base off of.
Not a whole lot of requirements P4Ruby is really it.
Mileage may vary for specific cases, but for the things I needed it worked just fine.
I am sure there a million ways to make this better, and hopefully I fit it into the model well enough.
Updated by Karim Trott 5 months ago
Hi Jeff,
have you checked compatibility with the release 0.8.0 of redmine?
regards,
Updated by Karim Trott 5 months ago
I did check myself, there are no further changes, so you can take this for release 0.8.0 as well...
Updated by Jeff Rorison 5 months ago
- File perforce_scm_adapter.diff added
Ok, hopefully created a diff for the Perforce adapter that follows the project standards.
Created against 0.8.0 (stable). No changes at this time.
One quick note on the depot path. It should be entered without the
everything ('/...') file spec notation.
Updated by Karl Pietrzak 5 months ago
Karim Trott wrote:
Karl Pietrzak wrote:
Karim Trott wrote:
As Perforce and P4Ruby has been released on rubyforge, does this raise the probalitiy for Perforce SCM support?
I think I'd be interested in writing Perforce support, as I have a running installation and we're exploring using Redmine.
This sounds good Karl, looking forward on this adapter, tell me when you need additional help.. I'll try to support when I can..
Looks like Jeff Rorison beat us to it :) I'm not gonna give his patch a try real soon. Thanks so much, Jeff!
Updated by Sven Engelhardt 5 months ago
the perforce patch works for me with an external repository except for the files all have 0 byte size (and wont view nor download)
Updated by Karl Pietrzak 5 months ago
Sven Engelhardt wrote:
the perforce patch works for me with an external repository except for the files all have 0 byte size (and wont view nor download)
Very interesting, Sven... I haven't given it a try yet, but luckily I don't think I have any 0 byte files in our p4 repo.
Updated by Karim Trott 5 months ago
hmm,
a confirugation problem? may be the usage of the different SCMs should be bette documented.
Updated by Jeff Rorison 5 months ago
Not sure about the 0 byte files. Never saw that even when messing the whole thing up real bad. ;-)
I did forget something on view & download (same thing really), when doing some different user scenario tests.
It's a small change here on the diff:
redmine/lib/redmine/scm/adapters/perforce_adapter.rb#314
- #p4.user = @login
+ p4.user = @login
- User at the repo level (current implementation)
- or User defined by Redmine login (sorta like #1913, pwd is an issue in my ldap case)
- or Custom fields on the user to define P4 user/pwd (need some learning on my part here)
I am cramped for time to work on this for a couple of weeks, apologies for no updated diff.
Updated by Andrew Levshoff 4 months ago
Guys, is there any plans about including provided by Jeff Rorison patch for supporting Perforce SCM into official Redmine source? If "yes", could you please update Target version of this issue (and may be Category to "SCM")? If "no"... its a pity, but looks like this issue could be closed, because support for all other requested SCM already implemented (as far as I can see here in comments).
Anyway despite the fact that supporting Perforce SCM out of the box could be REALLY awesome, thanks for supporting so many other SCM!
Updated by Eric Davis 4 months ago
- Category set to SCM
Andrew Levshoff wrote:
Guys, is there any plans about including provided by Jeff Rorison patch for supporting Perforce SCM into official Redmine source?
The patch is missing tests so it's not ready for inclusion into the core. If someone could update the patch with some unit tests, we could see about including it.
Updated by Wade Brainerd 3 months ago
- File perforce_adapter.rb added
I fixed a bunch of bugs in this plugin for our local use. All the changes are in perforce_adapter.rb so I'm just attaching that file.
- Fix diff with a specific revision and no path. Required initiating a connection before calling 'p4 changes', p4 variable was undefined.
- Fix diff with a specific revision and a path. Was comparing files against #head, now compares against previous revision.
- Fix 'cat'. Login name was commented out as per earlier post.
- Clean up and fix bugs in entry_name, relative_path and fix_url.
With these changes, everything appears to work fine with my depot.
Updated by Ryan Mensching 2 months ago
I have everything working including the new adapter attached above. I have one small issue at the moment attaching to perforce servers that need passwords. Any one else tried it with passwords and have issues? Is there a way to debug the password field it is trying to pass to p4?
As was mentioned above perforce support is crucial for game developers so having this fully functional is a must.
Updated by Andrew Levshoff 2 months ago
Wade Brainerd wrote:
I fixed a bunch of bugs in this plugin for our local use. All the changes are in perforce_adapter.rb so I'm just attaching that file.
- Fix diff with a specific revision and no path. Required initiating a connection before calling 'p4 changes', p4 variable was undefined.
- Fix diff with a specific revision and a path. Was comparing files against #head, now compares against previous revision.
- Fix 'cat'. Login name was commented out as per earlier post.
- Clean up and fix bugs in entry_name, relative_path and fix_url.
With these changes, everything appears to work fine with my depot.
Wade Brainerd and Jeff Rorison, guys, if you are so gentle to write code for this awesome Perforce SCM provider, would you be so kind to add some tests to your code and make us, mortal beings, happy to use that provider in official release? :)
Updated by George Gensure 2 months ago
Unified diff output from the original perforce_adapter.rb was coming down without any line breaks. Had to add a new line to each push into the diff array:
~294: # look for file identifier..if found replace date/time with change#
~295: diff << (line.gsub(/\d{4}\/\d{2}\/\d{2}\s+\d{2}:\d{2}:\d{2}/, "#{change}") + "\n")
Updated by Ryan Mensching 2 months ago
Ryan Mensching wrote:
I have everything working including the new adapter attached above. I have one small issue at the moment attaching to perforce servers that need passwords. Any one else tried it with passwords and have issues? Is there a way to debug the password field it is trying to pass to p4?
As was mentioned above perforce support is crucial for game developers so having this fully functional is a must.
The problem seems to be only with the p4 servers using our external AD authentication trigger. Standard p4 passwords or no password works fine. Will have to spend some time to figure out what is happening with the p4api/p4ruby on this. The loading of the changelist revs is pretty slow for servers that have 1000s of changes so some tweaking of the commands is needed I think.
Updated by George Gensure 2 months ago
Requests for the Perforce scm_info lastrev are sorely disappointed when a branch is specified that does not exist. (Caused a significant problem for me when using Repository.fetch_changesets on a regular basis). I added this after line 48 in lib/redmine/scm/adapters/perforce_adapter.rb to compensate:
return Info.new({:root_url => url, :lastrev => Revision.new({:identifier => -1, :time => nil, :author => nil})}) if h.nil?
Updated by George Gensure 2 months ago
Ryan Mensching wrote:
The problem seems to be only with the p4 servers using our external AD authentication trigger. Standard p4 passwords or no password works fine. Will have to spend some time to figure out what is happening with the p4api/p4ruby on this. The loading of the changelist revs is pretty slow for servers that have 1000s of changes so some tweaking of the commands is needed I think.
Perforce being the exception rather than the rule here for returning large result sets (like p4 changes //...), I've gone ahead and modified my copy of the app/models/repository/perforce.rb to skip the '200 at a time loading' behavior, and just import a project's /... all in one p4.run_changes. Its quite speedy, and I highly recommend it over the incremental loading.
Updated by Ryan Mensching 2 months ago
George Gensure wrote:
Requests for the Perforce scm_info lastrev are sorely disappointed when a branch is specified that does not exist. (Caused a significant problem for me when using Repository.fetch_changesets on a regular basis). I added this after line 48 in lib/redmine/scm/adapters/perforce_adapter.rb to compensate:
> [...] >
Interesting, can you give diff view of your change?
Updated by Ryan Mensching 2 months ago
George Gensure wrote:
Ryan Mensching wrote:
The problem seems to be only with the p4 servers using our external AD authentication trigger. Standard p4 passwords or no password works fine. Will have to spend some time to figure out what is happening with the p4api/p4ruby on this. The loading of the changelist revs is pretty slow for servers that have 1000s of changes so some tweaking of the commands is needed I think.
Perforce being the exception rather than the rule here for returning large result sets (like p4 changes //...), I've gone ahead and modified my copy of the app/models/repository/perforce.rb to skip the '200 at a time loading' behavior, and just import a project's /... all in one p4.run_changes. Its quite speedy, and I highly recommend it over the incremental loading.
Did you just remove the -m max flag from all the p4 changes commands?
Updated by Ryan Mensching 2 months ago
Ryan Mensching wrote:
The problem seems to be only with the p4 servers using our external AD authentication trigger. Standard p4 passwords or no password works fine. Will have to spend some time to figure out what is happening with the p4api/p4ruby on this. The loading of the changelist revs is pretty slow for servers that have 1000s of changes so some tweaking of the commands is needed I think.
I fixed this issue by adding a p4.run_login after every p4.connect in lib/redmine/scm/adapters/perforce_adapter.rb.
Updated by George Gensure 2 months ago
Ryan Mensching wrote:
Interesting, can you give diff view of your change?
Diffed against the latest version attached to this issue:
--- perforce_adapter.rb.orig 2009-04-20 16:24:15.949960000 -0400
+++ perforce_adapter.rb 2009-04-20 16:26:10.950650000 -0400
@@ -46,6 +46,7 @@
# get latest change for the depot spec
h = p4.run_changes("-m 1 -s submitted", "#{path}...").shift
+ return Info.new({:root_url => url, :lastrev => Revision.new({:identifier => -1, :time => nil, :author => nil})}) if h.nil?
change = P4Change.new( h )
info = Info.new({:root_url => url,
Updated by George Gensure 2 months ago
- File perforce_bulk_load.patch added
Ryan Mensching wrote:
Did you just remove the -m max flag from all the p4 changes commands?
Nope. Modified the repository/perforce.rb loader. Diff is attached (hope this doesn't clutter up this issue too much).
Updated by Alex Kates about 1 month ago
I installed all the files listed above. My Redmine GUI is updated with Perforce functionality. However, the Repository page is a blank table. The headings (Name, Size, Revision, Age, Author, Comment) are listed across the top, but it seem that the link to my depot is non-existant. I am sure I entered the settings correctly. Is this issue documented with anyone else? Can any provide input to this?
Updated by Alex Kates 24 days ago
Disregard my last post. Everything is working as intended.
I was getting the following error while opening specific depot files:
The entry or revision was not found in the repository.
The redmine/log/<environment>.log file will show the following error:
Processing RepositoriesController#browse (for #### at 2009-06-09 13:38:32) [GET]
Session ID:##########################
Parameters: {"action"=>"browse", "id"=>"pit", "controller"=>"repositories", "path"=>["VSPluginSolution"]}
Error creating entries: undefined method `filesize' for #<P4Revision:0xb6a5f788>_
- Open redmine/root/app/controllers/repositories_controller.rb
- Find "filesize"
- Delete it from the hash
The method "filesize" does not exist, and is only used once inside this hash. Removing this fixed my repository view.
Updated by Roman Starkov 20 days ago
- File redmine-perforce-v2-r2786.zip added
I've fixed a few bugs in the Perforce plugin:
- From/to revisions were swapped, causing incorrect sets of changes to be retrieved
- The p4 changes command attempted to guess the maximum number of revisions to get. Replaced with a command that directly retrieves only the required revisions.
- Old/new versions were swapped in the full changelist diff view.
- Added logger.debug to verify operation
Looking at the log output, the initial retrieval of all the changelists can be further sped up, however I have no plans to work on this at the moment. The zip file contains a diff against r2786, another one against the earlier version of this plugin (all the other diffs taken together), and all the changed files. These files also work (for me) in 0.8 stable.
Enjoy!