Opened 15 years ago
Closed 14 years ago
#380 closed task (fixed)
copy cache
Reported by: | Peter Johansson | Owned by: | Peter Johansson |
---|---|---|---|
Priority: | major | Milestone: | svndigest 0.8 |
Component: | core | Version: | trunk |
Keywords: | Cc: |
Description
The use case is when, e.g., creating a branch and suddenly having two wc.
Change History (27)
comment:1 Changed 14 years ago by
Milestone: | svndigest 0.x+ → svndigest 0.8 |
---|---|
Owner: | changed from Jari Häkkinen to Peter Johansson |
comment:2 Changed 14 years ago by
Milestone: | svndigest 0.8 → svndigest 0.9 |
---|
comment:3 follow-up: 4 Changed 14 years ago by
Milestone: | svndigest 0.9 → svndigest 0.8 |
---|
comment:4 follow-up: 5 Changed 14 years ago by
Replying to peter:
How we currently copy the cache in ReleaseProcedure (copying the entire wc) is ridiculous so I move this ticket to version 0.8. It should be an easy task to write a shell script doing the copying.
There is no cache information in ReleaseProcedure for svndigest but for yat, http://dev.thep.lu.se/yat/wiki/ReleaseProcedure. And you are right, we should have a script for that. For beauty we will pay.
comment:5 Changed 14 years ago by
Replying to jari:
Replying to peter:
How we currently copy the cache in ReleaseProcedure (copying the entire wc) is ridiculous so I move this ticket to version 0.8. It should be an easy task to write a shell script doing the copying.
There is no cache information in ReleaseProcedure for svndigest but for yat,
comment:6 Changed 14 years ago by
Status: | new → assigned |
---|
I'm thinking of an interface that looks something like this:
Known options are: -h, --help print this help and exit -r, --root=ROOT directory to copy cache from -t, --target=TARGET directory to copy cache to --version print version and exit
We find all files under ROOT
with name '*.svndigest-cache
' residing in a directory '.svndigest
', and copy those files to the corresponding location in TARGET
.
Would this be OK?
comment:7 follow-up: 8 Changed 14 years ago by
There are many errors that may happen. What if the directory structure is not the same? How does the cache usage in svndigest work if cache information is not syncronized, i.e., due to some freak event cache level may be different between files and directories?
comment:8 follow-up: 9 Changed 14 years ago by
Replying to jari:
There are many errors that may happen.
Indeed
What if the directory structure is not the same?
I think it makes sense to create the mother directory '.svndigest
', but if its mother directory does not exists, I think we exit 1
.
How does the cache usage in svndigest work if cache information is not syncronized, i.e., due to some freak event cache level may be different between files and directories?
Only files are cached. Directories get their stats from daughter nodes, and this is true both when using cache and when talking with svn repo.
comment:9 follow-up: 10 Changed 14 years ago by
Replying to peter:
How does the cache usage in svndigest work if cache information is not syncronized, i.e., due to some freak event cache level may be different between files and directories?
Only files are cached. Directories get their stats from daughter nodes, and this is true both when using cache and when talking with svn repo.
Ok, but can files in the same directory have different cache level? Or is the same cached revision expected?
comment:10 follow-up: 11 Changed 14 years ago by
Replying to jari:
Ok, but can files in the same directory have different cache level? Or is the same cached revision expected?
The cache of each file reflects the revision of that particular file. So I guess you can have a cache structure reflecting a mixture of revisions. This could probably be problematic, although I cannot see the exactly what the problem would be, but this is not a problem only here. I've experienced problem when running copyright on a mixed revision and often resulting in an assert. It might be a good idea to check for mixed revisions already in Parameter::analyse, or is it a desired feature?
comment:11 follow-up: 12 Changed 14 years ago by
Replying to peter:
Replying to jari: The cache of each file reflects the revision of that particular file. So I guess you can have a cache structure reflecting a mixture of revisions. This could probably be problematic, although I cannot see the exactly what the problem would be, but this is not a problem only here. I've experienced problem when running copyright on a mixed revision and often resulting in an assert. It might be a good idea to check for mixed revisions already in Parameter::analyse, or is it a desired feature?
If we cannot guarantee proper functionality with mixed revision cache then we should check for that.
My worry is that if we start to copy cache then one could imagine that one sub-tree has a copied cache whereas another has none (or another cache). But, maybe I misunderstand what copy cache is supposed to accomplish? What are the restrictions on the source and target? Should we use source instead of root?
comment:12 follow-up: 14 Changed 14 years ago by
Replying to jari:
Replying to peter:
Replying to jari: The cache of each file reflects the revision of that particular file. So I guess you can have a cache structure reflecting a mixture of revisions. This could probably be problematic, although I cannot see the exactly what the problem would be, but this is not a problem only here. I've experienced problem when running copyright on a mixed revision and often resulting in an assert. It might be a good idea to check for mixed revisions already in Parameter::analyse, or is it a desired feature?
If we cannot guarantee proper functionality with mixed revision cache then we should check for that.
I opened a ticket:415 for that.
My worry is that if we start to copy cache then one could imagine that one sub-tree has a copied cache whereas another has none (or another cache).
I don't see a problem with that. The cache file is used by the Stats class that uses it as follows:
- If no cache file get stats from repo and we are done
- else build stats from cache file
- if cache is uptodate, i.e., it reflects same revision as file then we are done.
- else talk to repo to get stats for remaining revisions
This happens for each file independently, so I don't see a problem with having some files cached and some not. The files that have cache will use its cache and those which don't won't. Or am I'm missing something here?
But, maybe I misunderstand what copy cache is supposed to accomplish?
I don't know; that is as always hard to tell ;)
What are the restrictions on the source and target?
Well in the implementation I'm working on I'm using find
and cp
, so the obvious requirements are that source is readable and target is read/writable. I have no plans in making the copy atomic, but files will be copied sequentially and when an error occurs the script exits.
Other restriction is that directories must pre-exist in target, with the exception of .svndigest directories. These will be created because the typical use case is that target is a fresh pristine wc.
Should we use source instead of root?
Sure. I suggested --root because that is what we have in svndigest, but we can use --source. Is that inspired from cp
? Should we use destination as well?
comment:13 Changed 14 years ago by
(In [907]) Autoconf 2.63 is now required (closes #414).
refs #380. A first implementation of svndigest-copy-cache. It is is written in M4sh. Autoconf compiles the source in svndigest-copy-cache.as to svndigest-copy-cache.in, which in turn is processed by config.status to replace some keywords such as PACKAGE and friends. There is no docs and no test yet.
added *.as in config file
comment:14 follow-up: 22 Changed 14 years ago by
Replying to peter:
Sure. I suggested --root because that is what we have in svndigest, but we can use --source. Is that inspired from
cp
? Should we use destination as well?
If we claim cp
inspiration we should stick with target. One thought, will it be confusing to have root/target for svndigest and source/destination for copy cache? Hm, maybe we should stick with root/target?
comment:15 follow-up: 16 Changed 14 years ago by
bootstrap
is complaining
svndigest> ./bootstrap autom4te: cannot open svndigest-copy-cache.in: Permission denied autom4te: cannot open svndigest-copy-cache.in: Permission denied autom4te: cannot open svndigest-copy-cache.in: Permission denied svndigest> autoreconf --version autoreconf (GNU Autoconf) 2.64 Copyright (C) 2009 Free Software Foundation, Inc.
Does this issue belong to this ticket?
comment:16 Changed 14 years ago by
Replying to jari:
bootstrap
is complainingsvndigest> ./bootstrap autom4te: cannot open svndigest-copy-cache.in: Permission denied autom4te: cannot open svndigest-copy-cache.in: Permission denied autom4te: cannot open svndigest-copy-cache.in: Permission denied svndigest> autoreconf --version autoreconf (GNU Autoconf) 2.64 Copyright (C) 2009 Free Software Foundation, Inc.Does this issue belong to this ticket?
Yes, most likely. What are the permissions on svndigest-copy-cache.in
when you get that error? Does it exist?
comment:17 Changed 14 years ago by
comment:18 Changed 14 years ago by
svndigest-copy-cache.in
existed and was read only. Removed the file updated and all is well now.
comment:19 Changed 14 years ago by
comment:20 Changed 14 years ago by
comment:21 Changed 14 years ago by
comment:22 follow-up: 23 Changed 14 years ago by
Replying to jari:
Replying to peter:
Sure. I suggested --root because that is what we have in svndigest, but we can use --source. Is that inspired from
cp
? Should we use destination as well?If we claim
cp
inspiration we should stick with target. One thought, will it be confusing to have root/target for svndigest and source/destination for copy cache? Hm, maybe we should stick with root/target?
I have no strong opinion, but I would vote for root/target. We should nail a decision here before implementing a possible change.
comment:23 Changed 14 years ago by
Replying to peter:
I have no strong opinion, but I would vote for root/target. We should nail a decision here before implementing a possible change.
Go for root/target.
comment:25 Changed 14 years ago by
comment:27 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
How we currently copy the cache in ReleaseProcedure (copying the entire wc) is ridiculous so I move this ticket to version 0.8. It should be an easy task to write a shell script doing the copying.