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

Re: svn:template (ignore local changes)?

From: Jay Levitt <lists-svndev_at_shopwatch.org>
Date: 2007-08-31 17:26:15 CEST

Daniel Rall wrote:
>
> On Aug 30, 2007, at 2:00 PM, Jay Levitt wrote:
>
>> Occasionally the question pops up from people who want to make local
>> changes to a template-type file and don't want them to be committed.
>> You can't put such a file into svn:ignore, because it does (and
>> should) exist in the repository; it just shouldn't be recommitted once
>> it's changed.
>
> This is indeed a common use case.
>
>> The FAQ states to rename the file to .tmpl or similar, and have
>> developers copy the file to its actual filename upon editing. That
>> works, but it's clunky, and requires everyone to take manual steps to
>> use that file, even if they don't plan to edit it. It also causes
>> particular issues for systems like Capistrano in Rails, which checks
>> out a copy of the repository and expects it to be deployable as-is.
>>
>> I'm sure it can all be worked around with commit hooks and checkout
>> hooks (are there checkout hooks?) and scripting and such, but an
>> svn:template parameter SEEMS, at first blush, to be a fairly
>> non-controversial feature that just hasn't made it onto anyone's list.
>
> So, if I've got this right, you add the svn:template property after
> creating the template, adding it, and committing it to the repository.
> However, if you want to modify the template, you remove the property,
> commit its removal (requiring a special hack to detect this case?), make
> your changes + restore the prop, and commit again.
>
> This makes the editing process awfully clunky...

Nonono, that would indeed be horrible.

I'm envisioning this behaviour:

- At some point after adding a file, somebody adds property
"svn:template" to the file.
- blame, cat, cleanup, copy, delete, info, list, lock, log, merge,
prop*, resolved, revert, unlock are unaffected by svn:template.
- status and update ignore the file, as if it were in its parent's
svn:ignore property.
- diff ignores the file if you are diffing its directory, but displays
the changes if you are diffing it directly.
- commit will, by default, ignore the file.
- If you pass --commit-updated-template to commit, it will check your
local changes in.

How's that sound?

>
>> Would a patch be likely to be accepted for such a feature? Is there
>> some big usage gotcha that I'm missing? I'd love to have this and it
>> seems like it should be relatively easy to code. It'd basically be
>> identical to the svn:ignore functionality, except that svn
>> up/co/export would have to get the file anyway (though I'm not sure
>> they look at svn:ignore today, since you can't have svn:ignore on an
>> existing file), and svn commit would have to be able to check in
>> changes to the template somehow (--force-changed-template or a better
>> name). Anything else?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 31 17:23:22 2007

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.