Subversion: Skipping folders when not in working directory - linux

We have our website files in various Subversion projects checked out on our Ubuntu 12.04 web server, a project for each site.
eg
/var/www/site1/
/var/www/site2/
/var/www/site3/
Now, I can update from subversion if I am in the correct working directory e.g. I go
cd /var/www/site1
svn update filepath
Works fine
...but if I go
svn update /var/www/site1
I get the error:
Skipped 'site1'
Is it do with the fact that each subfolder of /var/www is a seperate Subversion Project checked out seperately? Or am I misunderstanding something entirely.
Thanks!

You need to go into the working copy directory and then do svn up inside that folder.
You can refer another question SVN update: 'skipped' message

Related

Where can I find for the location of the repos managed by Gitosis in Linux

We are using Gitosis in our Linux OS server to manage our projects. One time, I mistakenly pushed the config file which contains errors and then I wasn't able to push changes or clone copies of other projects from the server anymore, including gitosis-admin itself. Now, I need to login to the server using the root user and edit the config file there.
So, when I logged on to the server I saw these files:
Then I cd into gitosis-admin:
Then I cd again into gitosis-admin:
Then I vim the config file. This is what I see:
The content is obviously not what I am expecting, because I should have other repos listed in this config file.
I also double checked with git reflog to see the commit history:
Then I thought there might be another gitosis-admin located somewhere else so I search using the command: find / -type d -name 'gitosis-admin'
This is what I got:
The two directories are the ones that I checked. And they do not match the one I have in my local computer.
I tried searching for one of our projects but still I got no result at all.
Then I thought that the root might not have access to the repo files so I switched to the git user by executing the following command:
sudo git
But still, I can't find the directory of the repos.
So now, I need to know where are the repos located so that I might find the "real" gitosis-admin there.
You might be wondering am I checking on the wrong server here. So to prove that I am not mistaken, this is a screenshot of the host address that I am connected to:
This is the remote address of the gitosis-admin git repo shown in source tree:
A typical directory would be the repositories sub-directory of the git user's $HOME directory, that is
~git/repositories
It is possible to change this location using the repositories key of the gitosis section in the configuration file, which typically is a file named .gitosis.conf in the git user's home directory.
To answer the implied question (namely which file to fix to restore gitosis access), that would be ~git/.gitosis.conf as well.
(This is all documented in the gitosis repository's readme file.)

Set SVNs working copy to public_html on cPanel server with external repos

When I do php programming, I tend to edit in-place on the (development) server (cpanel VPS, not local) via a text editor that has built in sFTP. I like this because there isn't 100 thinkgs you have to do to "publish" the changes, you save (via FTP) and reload the page.
I want to get the source into SVN mostly so I can track other people's edits.
I currently use tortoiseSVN on my windows machine to access hosted SVN repos (csvdude/codison) for non web projects so I'm familiar with that. Linux SVN, not so much.
My thought here (open to other ideas) is that I want the public_html folder on the server to be the working copy (Is there a problem with this?). People can make edits as they would via sFTP and then the working copy would be committed to the external SVN repo, possibly on a late night cron..hoping I can set it up to auto-add and commit.
So aside from thoughts on the idea, I'm curious how to set up the linux svn client to commit to external repos a la tortoiseSVN. It seems all the tutorials I see set up a local repo.
Additionally I'm worried when I check out with public_html dir as the working copy that it will overwrite everything. (yes I have backups...)
Any input or suggestions would be awesome.. Thanks.
I created a new repo on my hosted SVN service.
I manually created a public_html folder using the repo browser.
On the cPanel server:
cd /home/[account]/
svn checkout https://svnservice.com/my_repo/public_html
I set up an ignore list for directories in public_html I didn't want in the repo.
Then you can add files and directories to the repo
cd public_html
svn add [directory] // adds directory for commit
svn add --force . // adds all new files without ignoring the ignore list
In hindsight, I think the import command would have done something similar, I just didn't quite understand it enough.
This is a useful command as well:
svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm % // removes files from repo that no longer exist in the working copy
EDIT: One thing I should mention is to make sure your .htaccess blocks access to .svn directories or it could expose source code.

How to copy files in an svn repo to another folder on the server

Running a centos 6 server with svn repos stored on it. To deploy updates, I'd like to copy from the relevant directory within the svn repo to the appropriate /var/www website directory. Is there a simple way to do this?
Use the svn export command to do that. The subversion red book explains in detail how to do that.
When the relevant svn repo is stored under /export/svn/repo, and the part of the repository you want to copy from is /trunk/my_project/news, the whole command will be:
svn export file:///export/svn/repo/trunk/my_project/news /var/www/news

SVN Commit error: Can't open file txn-current-lock Permission denied

I can do checkouts, update and such. But when I try to commit changes, SVN gives me the following error:
Can't open file '/svn/p/pokemonium/code/db/txn-current-lock': Permission denied
I am using Windows 7 x64 SP1 with latest version of TortoiseSVN.
UAC is off, my account has read and write access, etc.
I can commit fine to other svn repositorys.
For me it ended up being a permissions issue on the server. I have my repo on a linux box, and ssh in to use svnadmin. For convenience sake, I had executed my create repository command as root. I was looking to get source I had on my Windows box into the repo, so was using TortoiseSVN to set up trunk/branches/tags. The directory containing the repo on the server was owned by root, and Tortoise was coming in as apache. I chowned the directory on the server to apache:apache, and it all went smoothly.
chown apache:apache -R my_repo_root
This is a server configuration issue. On windows host Visual SVN server runs under NETWORK SERVICE account by default. I solved this problem by granting full access rights to the repository folder to this account. Another option is switching Visual SVN service to the SYSTEM account, but that could pose a potential security risk.
Try this.
Make a back up copy of your working copy (just to be safe).
Make another copy your entire working copy off somewhere else.
Take the copy and delete all of the SVN folders out of it
Delete your working copy and do a fresh checkout
now copy/paste your corrupted working copy over your fresh checkout.
it is critical for this to work that you have completely removed ever _svn or .svn folder from your corrupted working copy before you perform the copy/paste.
This will leave you (hopefully) with a working copy that shows (!) on all the files you had modified since your last commit. And fixes your lock issue.
I had the same problem after I re-installed Windows 7 and just copied the SVN Repository from the old Windows to the new one.
After trying the steps that Mr. Manager proposed, the problem was still not fixed in my case.
After making sure that the permissions was setup correctly for the SVN Repository folder I just deleted the file 'txn-current-lock' in the /db folder of the project. That fixed it for me. From thereon I could commit my project again.
I had faced same issue on Unix box
Restarting the Apache service of the SVN server solved myproblem.
-f httpd.conf -k stop
-f httpd.conf -k start
In my own case, my linux server had been restarted after a power loss. The file system remained mounted as read-only since some journal repairs had been made. Rebooting the machine restored full function.
permissions worked for me too
error
repo/db/txn-current-lock: Permission denied
fix
chown apache:apache -R my_repo_root

gitweb not loading repositories through symlinks

I have gitweb on localhost and a sample project for which I've executed the git init git add and so on. I create a symlink with sudo ln -s /media/dir/project/.git/ /var/cache/git/project.git but it doesn't work and I still get 404 - no project found at localhost/gitweb.
The only way I can only bring the project info titles such as description, ..., then without project info, only the 4 sorting options, is to copy the git physically to /var/cache/git/project.git/ though some files won't be copied. This is the only way I could only not receive the not found error.
I manipulated the /etc/gitweb.conf and /etc/apache2/conf.d/gitweb in anyway, but it didn't help.
(I'm using apache 2.2 under Kubuntu 11.10)
Thanks so much for your helps!
Check the permissions on all of the directories in the symlink path. Whatever user your cgi is running as needs at least +x on all the parent dirs and +r on the .git directory and files.

Resources