1
$svn diff > patchfile

creates a nice patchfile. However, using TortoiseSVN under Windows I've set some files as being "ignored-on-commit", that is, it is under version control but doesn't get selected, when i do a commit.

TortoiseSVN seemingly handles this via a custom entry in .svn/entries for this file. Note, that it it isn't a normal SVN property (that is, not fetchable via svn propget).

My problem is, that I want to create a patch file via command line (via Cygwin's bash and SVN port), but this patch file should not include the files with this 'ignore-on-commit' flag.

Has anyone an idea how to do this (besides walking with awk recursively through each .svn/entries...)?

Boldewyn
  • 81,211
  • 44
  • 156
  • 212

3 Answers3

2

Apparently it's a special changelist entry. As for how to then ignore the file/s from the command line, it doesn't look like there's a particularly easy way.

Community
  • 1
  • 1
Blair McMillan
  • 5,299
  • 2
  • 25
  • 45
  • 1
    Thanks for the answer! An easy way is to list all files with a certain changelist entry, which can be done (how I learned right now) with `svn status --changelist ignore-on-commit working-copy`. That should do the trick. – Boldewyn Jan 13 '10 at 13:24
1

You can see the changelist via 'svn info' on the file. And set/reset changelists via 'svn changelist'

$ svn help cl
changelist (cl): Associate (or dissociate) changelist CLNAME with the named files.
usage: 1. changelist CLNAME TARGET...
       2. changelist --remove TARGET...

Valid options:
  -q [--quiet]             : print nothing, or only summary information
  -R [--recursive]         : descend recursively, same as --depth=infinity
  --depth ARG              : limit operation by depth ARG ('empty', 'files',
                            'immediates', or 'infinity')
  --remove                 : remove changelist association
  --targets ARG            : pass contents of file ARG as additional args
  --changelist ARG         : operate only on members of changelist ARG
                             [aliases: --cl]
Bert Huijben
  • 19,525
  • 4
  • 57
  • 73
  • But then I would have to grep all files recursively and call for every file the `svn info`. I think, parsing the output of `svn st --changelist ignore-on-commit` ould be easier. – Boldewyn Jan 13 '10 at 20:09
  • You can also use --depth infinity on 'svn info' to show all items. That should be a lot faster if the files are modified. (Status compares, info just shows the metadata) – Bert Huijben Jan 14 '10 at 13:05
1

I've had this problem too, and thus developed a simple command chain to server the need:

svn st | grep -A 1000 'ignore-on-commit' | grep -v 'ignore-on-commit' | sed 's/^.* //g' | xargs svn diff | gvim -

(Assuming there is less then 1000 files modified outside changelist 'ignore-on-commit')

Using this command, files modified outside changelist 'ignore-on-commit' will be diff-ed, and no file modification within 'ignore-on-commit' will be included.

James Fu
  • 498
  • 2
  • 4
  • 12