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

RE: API accessing property diff of svn:mergeinfo

From: Bert Huijben <bert_at_qqmail.nl>
Date: Wed, 6 May 2015 15:59:25 +0200

> -----Original Message-----
> From: Branko Čibej [mailto:brane_at_wandisco.com]
> Sent: woensdag 6 mei 2015 14:49
> To: users_at_subversion.apache.org
> Subject: Re: API accessing property diff of svn:mergeinfo
>
> On 06.05.2015 14:20, Bernhard Haumacher wrote:
> > Hi Branko,
> >
> >> On 06.05.2015 08:24, Bernhard Haumacher wrote:
> >> >
> >> > ... I'd
> >> > like to analyze the diff of the svn:mergeinfo property (what other
> >> > revisions were merged into some branch in a commit). ...
> >> >
> >>
> >> ISVNClient.getMergeinfoLog should give you that information.
> >>
> >> The upcoming 1.9 release will have http://s.apache.org/pVj which allows
> >> you to limit the revision range.
> >>
> >
> > I tried out your suggestion, but it seems that it cannot be used for
> > my purpose: I'm not interested in the merged revisions limited to
> > those revisions that were merged from a specific merge source (for
> > using the getMergeinfoLog() API, I do not have the `mergeSourceUrl`
> > info):
> >
> > {{{
> > getMergeinfoLog(Mergeinfo.LogKind kind, String pathOrUrl,
> > Revision pegRevision, String mergeSourceUrl,
> > Revision srcPegRevision,
> > Revision srcStartRevision, Revision
> > srcEndRevision,
> > boolean discoverChangedPaths,
> > Depth depth, Set<String> revProps,
> > LogMessageCallback callback)
> > }}}
> >
> > What I'm interested in is the combination of all merge sources plus
> > merged revisions that were merged within a single commit. At the
> > command line, this information can be retrieved with
> >
> > {{{
> > svn diff --depth empty -c<rev> <url of branch>
> > }}}
> >
> > resulting in e.g.:
> >
> > {{{
> > Eigenschaftsänderungen: .
> >
> ________________________________________________________________
> ___
> > Modified: svn:mergeinfo
> > Zusammengeführt /trunk:r161790
> > Zusammengeführt /branches/x:r160492
> > Zusammengeführt /branches/y:r185821
> > }}}
> >
> > Unfortunately, I cannot access this information using javahl in a
> > structured way?!
>
> You can call ISVNClient.getMergeinfo twice with the same path and
> different revisions and calculate the difference of the returned
> Mergeinfo structures. That's just a hash+list intersection.

In AnkhSVN I usually skip the diff apis and just obtain the whole files ('svn cat FILE' 'svn cat FILE_at_BASE') and properties ('svn proplist FILE' 'svn proplist FILE_at_BASE) and do the calculations myself.

That way I also have access to what is not changed.

Specifically for svn:mergeinfo you might be better of using the dedicated apis (which in many cases contact the server), but for all other properties I would guess just obtaining the values and explicitly apply further processing yourself is most likely far more future proof.

        Bert
Received on 2015-05-06 16:00:11 CEST

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

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