Opened 11 years ago
Closed 11 years ago
#518 closed task (fixed)
svncopyright character based (rather than line based)
Reported by: | Peter Johansson | Owned by: | Peter Johansson |
---|---|---|---|
Priority: | major | Milestone: | svndigest 0.11 |
Component: | svncopyright | Version: | trunk |
Keywords: | Cc: |
Description
Also stats in svndigest is currently line based as it is based on 'svn blame'. This implies that if we have a changeset
- Hello World! + Hello World
svncopyright sees that as one line added (and one deleted) and adds the committer into the set of authors. If we increase the resolution to charcters, we would notice that we delete one character and add none. Based on that one can have a rule that you have copyright if you have added a character in the file (excluding white-spaces and copyright statements).
Note, it's not necessary to make full blown diff for this, because we only need to know whether there was any character added. This is almost as easy as checking if two string are equal and can be done in linear time.
This is related to #102
Change History (12)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Status: | new → assigned |
---|
comment:3 Changed 11 years ago by
comment:6 Changed 11 years ago by
A speed bump. My planned path was to use svn_client_cat
to retrieve the file content of specific revisions, massage the content (e.g. remove Copyright lines and white-spaces), and then check if anything was added in the changeset in question. The speed bump is that svn_client_cat expands svn::key_words
such as $ID$
.
comment:7 Changed 11 years ago by
It wouldn't be too complicated to de-expand svn::keywords
: check the properties and if keywords is set and e.g. contain Id, look for '$Id*$' and replace it with '$Id$'. I hope there is no case this could bite us *you know where*, is there?
comment:8 Changed 11 years ago by
I asked users @ subversion if there is a way to turn off keywords expansion and got this answer:
No. But you could use svn_client_export5() instead which can ignore keywords as of Subversion 1.7.
I quickly looked into svn_client_export5 and there are two annoying things: 1) it requires 1.7 2) can not write to a string but must write on file. The latter is annoying and requiring 1.7 is - I guess - a killer.
comment:9 Changed 11 years ago by
Looking at the implementation of svn_client_cat2
, it seems svn_ra_get_file
should do what we need (without expanding keywords).
comment:10 Changed 11 years ago by
comment:11 Changed 11 years ago by
comment:12 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ticket #514 was marked as related.