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

Re: AW: Identify an text file

From: <kfogel_at_collab.net>
Date: 2004-08-24 14:55:23 CEST

"Sven Steiniger" <Sven.Steiniger@newtron.net> writes:
> 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.

Actually, it keeps all three versions -- the original unmodified, your
possibly-modified version, and the new version, so you can choose.

> 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.

Use 'svn status' to see if the file is marked as conflicted ('C')
after a merge.

My previous mail answered your question about what is treated as text,
I hope.

-Karl

> 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 Tue Aug 24 16:33:59 2004

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