SVN checkout browser - php

I've been looking all over for a SVN browser. Now I'm not talking about anything like WebSVN or TRAC, I don't want to browse the repository; I want to browse the checkout.
I'm looking for a program that lets me browse the checkout (working copy) and shows me the info I'd normally need to SSH for. So I could mark specific files or folders for some commit button, or see the status, or view a diff between the working and a prev version. Basically a web GUI for a svn checkout.
A [windows] program that can let you work on a remote checkout as if it were local would also work.
Currently I have a checkout on my server running under dev.mysite.com. I log in via ftp and edit and upload the files. I also keep SSH open so I can do a svn st to see what files I've worked on and to commit changes. I want to work on the files on the same environment so I can't simply use a local checkout. But I don't want to need to work via SSH.
Are there any apps such as I described? Like a repo browser but for checkouts to do commits. Like WebTortoiseSVN or such.
Thanks

Why don't you SFTP-mount the remote site locally and use something like Tortoise SVN ( http://tortoisesvn.tigris.org/ ) to manage the SVN stuff locally?
For example you mount dev.yoursite.com as drive Z: and you can use it as a local drive. Tortoise SVN automatically finds that it holds a SVN checkout and you can use it transparently.

As the checkout information is stored in the file system is there any reason that you cant mount the ftp directory as a local folder (or just browse to the ftp:// url) and use tortoise on it?

Have you tried the pecl package?
http://www.php.net/manual/en/book.svn.php
It's an API for SVN, so it's not a GUI, but I'm sure you can build one on top.
On a sidenote: your question is somewhat difficult to understand for me. I am not sure what you are really asking for, so if you could clearify some more, I might be able to add to my question.
EDIT If you just need an SVN manager, then go with Tortoise (mentioned elsewhere) or consider using an IDE that has built-in SVN support, like Eclipse.

Related

NetBeans + FTP + BitBucket

I know this has been asked before, but I couldn't get the answer I needed.
Currently I'm developing an website using PHP and was using Notepad++ before, and it all worked well because I'm developing with a co-worker so we both keep on changing different files on the FTP.
Switched to NetBeans. All went ok, pulled the entire website via FTP to my local computer and everytime I edited a file and saved it uploaded to the FTP. But, there is a problem. If my colleague updates a file, it doesn't update on my local folder. So, I thought: "Let's try versioning".
Created a team on bitbucket, created a repository. All went ok.
But now, I'm in a struggle to get everything up and running on both NetBeans (mine and colleague's) so that my colleague is editing a file on his NetBeans and constantly saving so that it gets saved on FTP and only when he stops working on that file push it to BitBucket so that I can pull after.
Suggestions?
About setting up your work environment :
In order to set up your bitbucket repository and local clone, go read this link (official doc).
You will need to repeat the cloning part once for each PC (e.g : once on yours, once on your colleague's).
Read the account management part to see how you can tag your actions with your account, and your colleague's action with his own account.
Start using your git workflow ; when you are tired of always typing your password to upload modifications to your bitbucket account, take the time to read the ssh keys setup part - read carefully, you will need to execute the procedure once for you and once for your colleague.
Using your local git repository with Netbeans is pretty straightforward :
From netbeans, run the File > New Project ... command (default: Ctrl+Shift+N),
Select PHP application with Existing Sources and click Next >,
For the Sources Folder: line, select your local git directory,
Fill the remaining fields, and if you want the last Run configuration screen, then click Finish.
After the project is created in netbeans, you can modify the Run configuration part by right clicking on the project's icon, selecting the Properties menu entry, and going to the Run configuration item.
About solving your workflow "problem" :
Your current FTP workflow can lead you to blindly squash your colleague's modifications (when uploading), or have your colleague's modification blindly squash your own local modifications (when downloading). This is bad, and you will generally notice it only after the bad stuff happened - too late.
Correctly using version control allows you to be warned when this could potentially happen, and to keep an almost infinite undo stack on the modifications of the project's files. The cost, however, is that both of you will have to add several actions in your day to day workflow - some choices can not be made automatically.
You may find it cumbersome in the beginning, but it really pays off, and quite quickly - we're talking big bucks here. So use it and learn.
On top of using Ctrl+S to save your modifications on disk, you and your colleague will need to integrate 3 extra commands in your daily work :
Save your work to your local repository (git add / git commit)
Download the latest modifications shared by your colleague (git pull)
Upload your work to the central repository (git push)
You can access these commands :
from a terminal,
from a GUI frontend : you can try TortoiseGit for windows, or gitk for linux,
from Netbeans :
in the contextual menu of the files/folders in the project tree (right click on the item, there is a "Git" entry),
using the Team > Git > ... menu
Since you provided a git tag, I'll describe what's to do for Git.
set up a remote bare repo on a server that you both could access (BitBucket in your case):
http://git-scm.com/book/en/Git-on-the-Server-Getting-Git-on-a-Server
you both clone that remote repo to your local machines:
http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository#Cloning-an-Existing-Repository
each of you works in her part of the application. When one is done, publish the work to the server:
http://git-scm.com/book/en/Git-Basics-Working-with-Remotes#Pushing-to-Your-Remotes
By now, the remote server holds the version that was just pushed. What's missing is the deployment of the website. This has been discussed here:
Using GIT to deploy website
Doing so, you will decouple your work from that of your colleague since you're not changing files over FTP all the time. You work in your part, your partner works on her part. The work is getting merged and then a new version of the website gets published.
You can create git or Mercurial repositories in Atlassian Bitbucket (http://bitbucket.org). If your team is new to version control, i advise you no forks in your first project.
The easy solution ins to use Atlassian SourceTree (http://www.sourcetreeapp.com/) to control your code since there is a bug in netbeans. See NetBeans + Git on BitBucket
You need to create a new repository in bitbucket. I assume you already configure the ssh2 keys. Using Git you need:
git clone --bare --shared php_project php_project.git
git commit
Using Mercurial you need:
hg init
hg commit
Good luck / boa sorte
Pedro

What is the URL of this tortoise svn repository?

Using TortoiseSVN, I created a "repository" folder in htdocs directory (Apache web server and PHP). Opened repo-browser Included some files into it. The local URL is:
http://127.0.0.1:8080/repository/project
Now I wanna checkout files into a working folder. When I try to provide URL http://127.0.0.1:8080/repository/project, it doesn't work ?
This is the first time I am using URL (http://).
Previously i have been using file:// successfully. Also have used VisualSVN (for http://) but doing it with Tortoise directly, seems a better idea for me.
Creating repository inside web-space does not convert this repository automagically to be http-served by Apache
Single Apache instance can be ordinary web-server and backend for SVN|WebDAV at the same time
You must to read SVN Book and configure your Apache in order to have http-repositories
Try this link dude Work with Visual SVN Server & Tortoise SVN. This is step by step procedure how to install Visual SVN Server + Tortoise SVN Client Application and how to configure them.
For the Tortoise Url in my case I'm using https://fullcomputername/svn/NameofYourRepository or could find it in your Visual SVN Server Manager. The link that I provide to you will guide you how to find it. :)
It's Highly Recommended to use TortoiseSVN with VisualSVN because they work well together see VisualSVN Testimonials here.

Deploying website to an external test server with Eclipse

I need an effective way to automatically push changes made in Eclipse to a test web server. These are all PHP changes. I am thinking SCP or FTP would be great with an easy to use plugin, but I would be open to other suggestions.
Background
At my company, we have Windows development machines, but the only way to test the PHP is to push the code over to a Linux machine that is running an Apache installation. Normally, I would just test locally, using WAMPServer or XAMPP, but I just started with the company and their code base is full of OS specific code (one day we will fix that!).
I have currently setup Git on my machine and I simply commit everything over to a bare repo on the test server. Then I have a post-receive hook that forces a pull into the actual Apache web accessible folder.
This git setup works fine, but I really don't like polluting the blame log with useless commits (i.e. I added a comma to line X in javascript). Things like that are not useful to other developers.
In the end, I won't be pushing from my test server anyway. Instead, I'll be pushing from my Windows machine to a central git server for our team (once I get it set up), so I'm not really sure we should be using version control to deploy to the test web server. It seems like using an SCP or FTP plugin would make the most sense.
Question Restated
Are there any Eclipse plugins that could automatically SCP/FTP to a directory on file save? I've searched the Eclipse market place and I am really not sure where to go with this.
Thanks for your help!
Have a look at the Remote System Explorer plugin for Eclipse: http://eclipse.org/tm/

Update cvs and files with eclipse

In the past, with Eclipse and a PHP Server/system, I had it setup so that when I commited changes to the CVS repository, it also saved the actual php files on the server. I had this functionality on a another computer in the past (I can't check this computer). The files for the repository seemed to have been saved in a different folder. So the cvs is in a folder stucture like var/cvs and my system files/PHP files facing clients are in something like var/www/html/. How would one go about setting something like this up? I use sftp to change files right now with Filezilla. It was very convenient before being able to commit the changes and check the web to make sure that changes worked. Right now I have to commit the changes then save the file with ftp to see the changes. Would love to be able to get rid of the sftp with Filezilla step if at all possible...
It sounds to me that you are testing your latest changes on the live website, which is bad idea, because if you inadvertently edit some error in the files, your website may expose that to the public.
My current work-flow is as follows:
I use Netbeans on a local project, which is the SVN checkout too. On most projects I use the Netbeans option "Copy files from source folder to another location" to copy the edited files "on save" to the local test webserver directory. If the changes work on the local webserver, I'll commit them to the SVN repository and login to the live-webserver via SSH and checkout the latest revision from the SVN.
So in fact I have four copies of each file:
The working copy (a Netbeans project and SVN checkout)
/home/feeela/projects/xyz/ (editing here only)
The test-server copy; Netbeans stores a copy there on each save;
/var/www/vhosts/xyz/ (127.0.0.1/xyz/)
The SVN repository; I'll manually commit files to it after testing on the local webserver;
/var/svn/xyz/ (svn commit -m "my last change")
The SVN checkout on the live-server, which is the actual website;
/var/www/vhosts/xyz/ (svn update # xyz.com/)
I don't have a clue, how setup the "local copy" feature (which can also refer to some other machine) with Eclipse. If someone knows a way to reproduce the above workflow using Eclipse and not need to manually sync the files to the test-server, I#ll be glad to read it hereā€¦
You could use a post-commit hook script on the CVS server to update (refresh) a working copy on var/www/html/. Every time you commit, the hook script would thus get the latest version of the files on the server and put them in var/www/html/.

Working on PHP projects on a remote dev server via sFTP

I'm looking for an editor that can read and write remote PHP files via sFTP. I'm talking about not having a local copy of my PHP files.
But here is the tricky part : I'd like that editor to be aware of all the files in my projet, and provide me with intellisense-like auto-completion, classes structures, etc...Just like Eclipse PDT, Aptana and NetBeans do, but with the "remote project storage and awareness" feature.
Do you know about any editor with these features ?
Thanks !
Edit : I'm absolutely not working on my production server, but on a development server. It's mostly because I need to works under windows on my desktop PC and don't want host my projects locally for various compatibility and tools availability reasons, and use linux as a server OS.
May not be a good idea:
Warnings:
1) Disconnect:
What if you are coding and your connection gets lost, you may get a corrupted file or loose some work. Disconnects occur much more often that power loss in your home/office, and you can safeguard by using a small UPC - that will give a minute to save your work.
2) SCM:
Use git, mercurial, svn or what have you, to speed up deployment. Increases ability to share code, backup and roll backs.
3) Auto completion will not work very well over network connection, because ( at least in NetBeans) it scans your project to figure out what you want to auto-complete. It takes a few seconds even on a local machine.
Solution:
If after all of the above you still want to do it, you can trick your editor by mounting remote storage as a local drive. You didn't specify your OS but on Mac and Linux - you can easily do it - take a look at Fuse. http://fuse.sourceforge.net/
Khmm apperatnly there was an attempt to port Fuse to Windows:
http://fuse4win.4host.ru/
Hope that helps
Update
There are also a few commercial products - one was recommended by macworld I think ( they are both for Mac and Windows)
http://en.wikipedia.org/wiki/WebDrive
http://en.wikipedia.org/wiki/ExpanDrive
On Windows the Zeus editor can do seamless ftp/sftp editing.
These remote ftp files can also be defined to belong to a project/workspace.
But the Zeus PHP intellisensing will only work for local files.
You can use NetBeans for this, you will have your project saved locally but you can set to upload the file anytime when you save that file. Right click on your project, Properties, Run Configuration, Run As: Remote website. Click on Remote Connection: ... Manage and add your FTP account. Don't forget to set Upload files: to On Save. I have had no problem with this configuration and I am working for one year with NetBeans.
For quick editing I am using PSPad.
I don't think this is something that actually exists. Mainly because intellisense and class structures rely on being able to parse your complete project. Doing this over FTP would take way to long to actually be of any practical use.
You might be able to find an editor that will automatically upload any change you make locally though.
I'd second the comments about not working directly on your live environment.
As you've mentioned Eclipse / Aptana - perhaps consider using something like Git or SVN, with a post-commit hook to immediately publish to your live environment each time you commit. That way you reduce the risk by being able to easily roll back any changes that break your live server.
You can use Eclipse (with suitable git/svn plugin) to check out your entire site direct from the repository, and have all the code completion goodness you need. "Saving" is then just a case of committing your changes back to the repository, which would automatically update your server thanks to the post-commit hook.
It's still not ideal, and very risky to develop on a live server, but if you really have no preview environment, then this is perhaps slightly safer than simply working directly through ftp.
I'm curious why you'd need to not keep a local copy - yet you've said the project seems quite small - perhaps taking another approach to the problem would be safer?

Categories