[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Diff, ignore & deleted files

From: Bob Proulx <bob_at_proulx.com>
Date: 2005-07-03 19:08:47 CEST

Christer J. Nyfält wrote:
> - I ran svn diff and noticed that diff was very long and full of changes
> concerning Makefile.in files that I rather not see.
> - I decided to delete all Makefile.in files from the repository,
> svn:ignore them and rebuild them.

By what exact method did you use to delete those files? I believe
your problem lies in those details.

> An here comes the problem:
> The files deleted from the repository and ignored still clutter the diff
> if I compare with the original version. I could use --no-diff-deleted,
> but there will be occasions when I want to see other deleted files and
> old hide the ignored ones.
>
> So is there a way to solve this currently or should I file an issue
> request for adding a --no-diff-ignored flag for svn diff?

If they were really deleted then you would not see them in your diff
and they would not show up as an M in the status. Because you are
seeing them in your diff I believe you have not really deleted them.

Because there are differences in your working copy subversion will try
hard not to lose any of those changes. Therefore it is necessary to
make sure those files are not changed with regards to subversion
before performing some of the operations. I can think of at least
three ways to do this. Here is one way off the top of my head.

  svn revert $(find . -name Makefile.in -print)
  svn rm $(find . -name Makefile.in -print)
  svn commit
  autoreconf

The revert will make sure that the current files are the same as those
checked in. Otherwise subversion will avoid losing your changes by
refusing the operation. Then schedule those files for remove. Then
commit those changes. Then rebuild your files.

The observant unix/gnu user will realize that by running the find on
the command line I might overflow ARG_MAX and filenames with funny
characters such as spaces and newlines may cause trouble. But I
thought it was more clear that way by way of description. To avoid
any possiblity of overflowing the fixed size buffer for arguments and
avoid any problems with funny characters in filenames use find and
xargs together.

  find . -name Makefile.in -print0 | xargs -r0 svn revert
  find . -name Makefile.in -print0 | xargs -r0 svn rm
  svn commit
  autoreconf

Using -print0, print a zero terminated string so that filenames are
handled as binary data. The xargs command will expand as many args as
possible into each of the svn commands.

Bob

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Jul 3 19:10:58 2005

This is an archived mail posted to the Subversion Users mailing list.