You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Talden <ta...@gmail.com> on 2006/07/26 03:27:15 UTC

How do you atomically commit a selection of files/folders?

If "svn commit" doesn't accept a list of files/folders as arguments or
a 'list file' containing the set of things to commit how can I commit
a change-set in a single revision?

Is this something I've overlooked or is a future feature... Or do
other simply not see this as an issue?

I dislike the only solution I can think of... revert all changes you
DON'T want in the commit and then commit the entire working copy to
treat the remaining changes as a single revision.

--
Talden

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: How do you atomically commit a selection of files/folders?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jul 26, 2006, at 12:33, Talden wrote:

> It might be nice lthough to be able to mark files for inclusion in a
> commit-set or allow commit to accept a file (or stdin) of paths/files
> to commit so that deeply distant files and large checkins don't mean
> unbelievably large commandlines - or have I overlooked something there
> too.

Yes, we have that too! :-) Check out the --targets option:

$ echo some/path/to/file1.txt > targets.txt
$ echo a/path/to/another/file2.txt >> targets.txt
$ svn ci --targets targets.txt -m "Committing those two files"
$ rm targets.txt

$ svn help ci

commit (ci): Send changes from your working copy to the repository.
usage: commit [PATH...]

   A log message must be provided, but it can be empty.  If it is not
   given by a --message or --file option, an editor will be started.
   If any targets are (or contain) locked items, those will be
   unlocked after a successful commit.

Valid options:
   -q [--quiet]             : print as little as possible
   -N [--non-recursive]     : operate on single directory only
   --targets arg            : pass contents of file ARG as additional  
args
   --no-unlock              : don't unlock the targets
   -m [--message] arg       : specify commit message ARG
   -F [--file] arg          : read data from file ARG
   --force-log              : force validity of log message source
   --editor-cmd arg         : use ARG as external editor
   --encoding arg           : treat value as being in charset  
encoding ARG
   --username arg           : specify a username ARG
   --password arg           : specify a password ARG
   --no-auth-cache          : do not cache authentication tokens
   --non-interactive        : do no interactive prompting
   --config-dir arg         : read user configuration files from  
directory ARG

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: How do you atomically commit a selection of files/folders?

Posted by Talden <ta...@gmail.com>.
Sigh... Turns out I was thrown by having two folders (partial
checkouts) not technically in the same working space (the parent
folder wasn't part of the working copy)... Not understanding the error
at the time and mixed with misreading the help this was just simple
PEBKAC... All working fine and, so far, I'm finding SVN a massive step
up on CVS.

It might be nice lthough to be able to mark files for inclusion in a
commit-set or allow commit to accept a file (or stdin) of paths/files
to commit so that deeply distant files and large checkins don't mean
unbelievably large commandlines - or have I overlooked something there
too.

--
Talden


On 7/26/06, Ryan Schmidt <su...@ryandesign.com> wrote:
>
> On Jul 26, 2006, at 05:27, Talden wrote:
>
> > If "svn commit" doesn't accept a list of files/folders as arguments or
> > a 'list file' containing the set of things to commit [snip]
>
> But it does. If it's not working for you, you'd better show us
> exactly what commands you're executing (how you created the working
> copy, how you're trying to commit your changes) and what error
> messages are produced, and tell us what version of Subversion and
> what OS you're on.
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: How do you atomically commit a selection of files/folders?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jul 26, 2006, at 05:27, Talden wrote:

> If "svn commit" doesn't accept a list of files/folders as arguments or
> a 'list file' containing the set of things to commit [snip]

But it does. If it's not working for you, you'd better show us  
exactly what commands you're executing (how you created the working  
copy, how you're trying to commit your changes) and what error  
messages are produced, and tell us what version of Subversion and  
what OS you're on.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: How do you atomically commit a selection of files/folders?

Posted by Gavin Lambert <ga...@compacsort.com>.
Quoth Les Mikesell <ma...@gmail.com>:
>> You can also commit a subtree of your working copy either by naming
>> the folder on the commandline or by changing your current directory
>> to that folder before issuing the commit command.
> 
> When you do this, do the revisions go to the head, mingling
> with changes others have committed, or is there some way to
> check out exactly what is in your workspace again (including
> the version you checked out of the unchanged files and only
> the changes you just committed) without making a branch to
> keep these together?

They go to whatever branch you're currently in (which will normally be
the trunk, unless you've specifically switched over to a branch).

It's no different than naming all the files and subfolders in that
folder on the command line.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: How do you atomically commit a selection of files/folders?

Posted by Les Mikesell <le...@gmail.com>.
On Wed, 2006-07-26 at 00:24, Gavin Lambert wrote:

> > If "svn commit" doesn't accept a list of files/folders as
> > arguments or a 'list file' containing the set of things to
> > commit how can I commit a change-set in a single revision?
> 
> It does.  It's just that they all have to be part of the same working
> copy (ie. created with a single 'svn checkout' command).  As long as
> that's true you can put in as many specific files as you want.
> 
> You can also commit a subtree of your working copy either by naming the
> folder on the commandline or by changing your current directory to that
> folder before issuing the commit command.

When you do this, do the revisions go to the head, mingling
with changes others have committed, or is there some way to
check out exactly what is in your workspace again
(including the version you checked out of the unchanged
files and only the changes you just committed) without
making a branch to keep these together?

-- 
  Les Mikesell
   lesmikesell@gmail.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: How do you atomically commit a selection of files/folders?

Posted by Gavin Lambert <ga...@compacsort.com>.
Quoth Talden <ma...@gmail.com>:
> If "svn commit" doesn't accept a list of files/folders as
> arguments or a 'list file' containing the set of things to
> commit how can I commit a change-set in a single revision?

It does.  It's just that they all have to be part of the same working
copy (ie. created with a single 'svn checkout' command).  As long as
that's true you can put in as many specific files as you want.

You can also commit a subtree of your working copy either by naming the
folder on the commandline or by changing your current directory to that
folder before issuing the commit command.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org