Committing a Directory to Subversion
Asked Answered
K

9

11

Kind of a newbie question, but I am having problems using SNVKit.

I am using SVNKit in an application to commit changes to files. I have it successfully adding the files and folders to the working copy, but I am having problems committing it to the respository.

The command I am trying to run is 'commit -m "Test Add" /svnroot/project1/' but I keep getting "svn: '/home/user' is not a working copy"

I have a structure similar to this:

  • /svnroot/
  • /svnroot/project1/
  • /svnroot/project1/grouping1/
  • /svnroot/project1/grouping1/myfilesarehere

If I try to commit the file, I get the following message: "'/svnroot/project1/grouping1' is not under version control and is not part of the commit, yet its child is part of the commit."

What might I be doing wrong?

EDIT: Fixed the directories.

Kharif answered 26/9, 2008 at 14:45 Comment(0)
K
0

I have it tracked down to a possible bug somewhere. If I don't add a message it works. Time for more digging. Thanks for the pointers.

Kharif answered 26/9, 2008 at 15:49 Comment(3)
@Mike_Willis Can you share with us the solution you found, as I'm having that very problem.Anking
Definitely a bug. Just ran into it while committing two new folders with files. Nothing worked but committing every directory separately.Swanherd
You said it works if you don't add a message. Did you try removing the space between the -m flag and the message, so it was more like: -m"Test Add"? Not sure if this is required, but that's how I learned to do it.Feisty
I
21

If you have both a directory and its child added, but neither is not committed, I believe you get this message if you try to commit just the child. You need to commit the parent directory first.

Inspector answered 18/5, 2011 at 22:40 Comment(1)
Works perfect to me, when I read what you says I realize exactly my problem. ThanksContuse
N
2

I got this message and I noticed that I was doing a commit while I was in the sub-directory. When I switched to the root of the tree, it commited w/o issue.

Novia answered 7/8, 2013 at 3:14 Comment(0)
M
1

move your -m "comment" to the end. I would just change directory into your project directory. Then you just type svn commit -m "comment" and svn does the rest.

Moncton answered 26/9, 2008 at 14:50 Comment(1)
Moving the directory didn't work. Changing the directory is not an option that I know how to fix at this time. I'll look into that more.Kharif
B
1

I think the problem is that you are committing changes to the actual SVN repository itself instead of doing an import, checking out a copy for yourself, making changes, and then doing a commit from your checked-out working copy after adding any subdirectories. So: import, checkout, make changes, and then finally do an add for each new file or directory and commit -m "message" form the top level.

More information in the free online SVN "turtle" book.

Burstone answered 26/9, 2008 at 15:10 Comment(1)
No, this is the working copy. I previously did a checkout to this location.Kharif
A
0

It's not entirely clear because you've inconsistently replaced them, but it looks like you're getting repository paths/URLs confused with working copy paths. If you're adding or committing files, always use the working copy paths. Try playing around with the command-line svn before trying to use SVNKit.

Arielariela answered 26/9, 2008 at 14:50 Comment(0)
D
0

If you want to commit an entire new directory consider using svn import instead. As it stands right now you may have to revert or some other action clean up the current mess.

Danaus answered 26/9, 2008 at 14:54 Comment(0)
K
0

I have it tracked down to a possible bug somewhere. If I don't add a message it works. Time for more digging. Thanks for the pointers.

Kharif answered 26/9, 2008 at 15:49 Comment(3)
@Mike_Willis Can you share with us the solution you found, as I'm having that very problem.Anking
Definitely a bug. Just ran into it while committing two new folders with files. Nothing worked but committing every directory separately.Swanherd
You said it works if you don't add a message. Did you try removing the space between the -m flag and the message, so it was more like: -m"Test Add"? Not sure if this is required, but that's how I learned to do it.Feisty
A
0

Some times, using some Softwares such as eclipse or Versions.app produces this errors. In this case, quit the SVN client and do it on command line.

Actinomycin answered 29/10, 2013 at 15:24 Comment(0)
B
0

You have probably done some refactoring and you are trying to commit 'some.package.YourClass.java', in that case try commiting the directory(package) 'some'.

If you want to save yourself from such headache in the future consider switching to GIT instead of svn. Remember svn keeps your changes in a .svn file and tries to puch it to the repository. When you commit it will according to this .svn file push 'your changes'. But what if yo're changes are very complex? svn can't handle it.

GIT on the other hand: you retrieve all updates so your project is up-to-date. And when committing it just overwrites the repo, since it knows yours is most recent and no hustle.

Bayne answered 29/4, 2015 at 8:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.