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

AW: Identify an text file

From: Sven Steiniger <Sven.Steiniger_at_newtron.net>
Date: 2004-08-23 10:15:34 CEST

Nothing really matches.
During an checkout (merge) one may get conflicts which needs to be
resolved. For text files, svn inserts the cute <<<< >>>> marker in the
files. For binary files it just keeps one version.
We are using some scripts for working with CVS. Those scripts have now
been ported to work with Subversion. For user satisfaction most stuff has
been automated. To safely resolve an conflict file in Subversion, we do
the following:
 - for text files, check if there are any <<< or >>> inside. If not resolve it
 - for binary files, check wheter they have been touched after checkout.
   if yes, the resolve it
As I don't know what Subversion treats as text-file, I need an
command line option to query it. Getting the mime-type to check this is
just a worka-round.

Sven.

-----Ursprüngliche Nachricht-----
Von: kfogel@collab.net [mailto:kfogel@collab.net]
Gesendet: Freitag, 20. August 2004 15:30
An: Sven Steiniger
Cc: users@subversion.tigris.org
Betreff: Re: Identify an text file

"Sven Steiniger" <Sven.Steiniger@newtron.net> writes:
> I just wondered if there is a safe way to ask subversion if an working file
> is treated as an text file or not.
> I am currently getting the 'svn:mime-type' property and check if it's empty or
> starts with "text/". But the documentation tells
> "For example, if a file's svn:mime-type property is set to a
> non-text MIME type (generally, something that doesn't
> begin with text/, though there are exceptions)"

Actually, your question probably need to be expanded.

What, precisely, do you mean by "is treated as text"? That is, are
you talking about end-of-line translation, or keyword substitution, or
responsiveness to 'svn diff' and/or 'svn merge', or some combination
thereof, or something else entirely?

If you're just interested in mime-types, our (not entirely
satisfactory) solution for now is the function
svn_mime_type_is_binary() in subversion/libsvn_subr/validate.c. See
also

   http://subversion.tigris.org/issues/show_bug.cgi?id=1002

Best,
-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Aug 23 10:15:59 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.