I got the same problem and resolved it by your solution..
Thanks Andrew Aucott-3 :)


Andrew Aucott-3 wrote:
> 
> Art, consider the following, it may be simpler...
> 
>                  // setup your repository here
>                  long latest = repository.getLatestRevision();
>                  SVNPropertyValue value =  
> msgRepo.getRevisionPropertyValue(
>                          latest, SVNRevisionProperty.LOG);
>                  if (value == null)
>                      msg = "";
>                  else
>                      msg = value.getString();
> 
> 
> On Apr 3, 2009, at 4:00 PM, AMcBain wrote:
> 
>>
>> I resolved my own problem. Instead of relying on  
>> SVNEntry.getCommitMessage()
>> I just ask my repository for a log from that SVNEntry's revision and  
>> cache
>> the result.
>>
>> I do that with this code:
>>
>>              int revision = -1;
>>              try {
>>                      Collection<SVNLogEntry> log =  
>> (Collection<SVNLogEntry>)repository.log(new
>> String[]{}, null, revision, revision, true, true);
>>
>>                      Iterator<SVNLogEntry> entries = log.iterator();
>>                      if(entries.hasNext()) {
>>                              return entries.next().getMessage();
>>                      }
>>
>>                      return "";
>>              } catch (SVNException e) {
>>                      e.printStackTrace();
>>              }
>>
>>
>> AMcBain wrote:
>>>
>>> I should probably note that the only external JAR I include is  
>>> svnkit.jar
>>> (no JNA). I didn't seem to make a difference if I included the JNA  
>>> version
>>> or any of the other JARs available through the download.
>>>
>>> The version of SVNKit I'm using is the most recent stable release:  
>>> 1.2.3
>>> I also have the VM option '-Dsvnkit.http.methods=Basic,NTLM'* as  
>>> well as
>>> the logging argument.
>>> The log doesn't seem to turn up anything out of the ordinary.
>>> * The private svn server I tested with requires it.
>>>
>>> However, I might be missing something. If my setup is missing  
>>> something
>>> (or not configured right) I would appreciate some help in  
>>> correcting it.
>>>
>>>
>>> AMcBain wrote:
>>>>
>>>> SVNKit does not seem to have commit messages for SVNEntry instances.
>>>> Every instance I got from a repository always said the commit  
>>>> message
>>>> was null. I can get the last commit message by getting the "log"
>>>> property from the repository instance, but I was hoping for more  
>>>> detail
>>>> than that. What I was hoping to find was the latest revision (for  
>>>> that
>>>> file)'s commit message. I tried this with both a private (password
>>>> protected) repository and a public one, available here:
>>>> https://svn.origo.ethz.ch/javable-widget-libs/
>>>>
>>>> This is the code I connect to the repository with:
>>>>
>>>>       SVNRepository repository = null;
>>>>        try {
>>>>            repository =
>>>> SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url));
>>>>
>>>> repository 
>>>> .setAuthenticationManager 
>>>> (SVNWCUtil.createDefaultAuthenticationManager(name,
>>>>
>>>> password));
>>>>            repository.testConnection();
>>>>        } catch (SVNException e) {
>>>>            e.printStackTrace();
>>>>        }
>>>>
>>>>
>>>> This is the code boiled down code I used when I found the empty  
>>>> commit
>>>> messages:
>>>>
>>>>        try {
>>>>            List<RepositoryEntry> items = new
>>>> ArrayList<RepositoryEntry>();
>>>>
>>>>            Iterator<SVNDirEntry> iterator =  
>>>> ((Collection<SVNDirEntry>)
>>>> repository.getDir(path, -1, null, (Collection<SVNDirEntry>)
>>>> null)).iterator();
>>>>            while(iterator.hasNext()) {
>>>>                SVNDirEntry entry = iterator.next();
>>>>
>>>>                System.out.println(entry.getCommitMessage());
>>>>            }
>>>>        } catch (SVNException e) {
>>>>            e.printStackTrace();
>>>>        }
>>>>
>>>> And lastly, here's how I got the log:
>>>>
>>>>        try {
>>>>            repository.getLastRevisionProperty("svn:log");
>>>>        } catch (SVNException e) {
>>>>            e.printStackTrace();
>>>>        }
>>>>
>>>> I'd like to get to the bottom of this, so I appreciate any help.  
>>>> Thanks
>>>> very much.
>>>>
>>>> - Art McBain
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>>
>>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Empty-commit-messages-tp22873905p22874229.html
>> Sent from the SVNKit - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Empty-commit-messages-tp22873905p31547856.html
Sent from the SVNKit - Users mailing list archive at Nabble.com.


Reply via email to