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

Re: line-ending conversion and keyword substitution

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2001-12-12 20:05:23 CET

On Wed, 2001-12-12 at 13:54, Ben Collins-Sussman wrote:
> My confusion is in the bootstrapping of this process. How does one
> create and add a file that contains keywords? If we expanded the
> keywords in the working file after the very first commit, then as soon
> as the commit was over, the file would have a local mod (because it
> would no longer match text-base, which still has the unexpanded
> keyword.) Is this ok? Would the user have to commit *again*?

It doesn't count as a local mod. Our is-modified predicate has to
keyword-expand the repository contents before comparing against the
working version to determine if a file is locally modified.

This is how CVS works (although I would propose that we handle merges a
bit differently, and maybe diffs, but that can be a topic for the
future). Try it:

  mkdir -p /tmp/repos/CVSROOT /tmp/repos/foo
  setenv CVSROOT /tmp/repos
  cvs init
  cd /tmp
  cvs co foo
  cd foo
  echo '$Id$' > blah
  cvs ci -m test blah

Now look at /tmp/repos/foo/blah,v. Notice that the text of rev 1.1 is
just "$Id$"--what is committed is exactly what was in the file. But if
we look in the version file, the keyword has been expanded. Now try:

  cvs diff blah

You get no output, because the repository keyword-expands the repository
contents of rev-1.1-blah before performing the diff. On the other hand,
if you disable that keyword expansion with "cvs diff -ko blah", you'll
get a difference.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:52 2006

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

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