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

RE: How to check which branches have specific commit

From: Bert Huijben <bert_at_qqmail.nl>
Date: Wed, 22 Feb 2017 10:14:25 +0100

> -----Original Message-----
> From: Thijs de Ridder [mailto:thijs.de.ridder_at_mep-info.com]
> Sent: woensdag 22 februari 2017 10:10
> To: users_at_subversion.apache.org
> Subject: How to check which branches have specific commit
>
> We have an svn repository with several branches and tags.
>
> - trunk/
> - branches/
> - stable_1
> - stable_2
> - etc.
> - tags/
> - stable_1_release_a
> - stable_1_release_b
> - etc.
>
> We develop our software in trunk (or in a development branch which will be
> reintegrated to trunk). We merge the changes from trunk to a stable
branch.
> Sometimes we discover a bug which has been introduced quite some time
> ago.
> Because the list of branches becomes quite long, I would like to know if
it
> is possible to easily see in which branches / tags the bug is? So if for
> instance the bug was introduced in r50 in trunk and currently we are at
> r100, is there an svn command to see which branches / tags have r50 of
trunk
> merged? So we could easily see which branches are infected by this bug?
> An svn command or via tortoisesvn will help us a lot (although for
> tortoisesvn I should ask this on the tortsoisesvn mailing list)

Subversion currently doesn't track where something was branched to, only
where something was branched from... so there is no feature that can tell
you which of all locations miss a certain 'merge'.

For a specific branch you can see if it still needs specific merges via 'svn
mergeinfo --show-revs=eligible'

[[
$ svn help mergeinfo
mergeinfo: Display merge-related information.
usage: 1. mergeinfo SOURCE[@REV] [TARGET[@REV]]
       2. mergeinfo --show-revs=WHICH SOURCE[@REV] [TARGET[@REV]]

  1. Summarize the history of merging between SOURCE and TARGET. The graph
     shows, from left to right:
       the youngest common ancestor of the branches;
       the latest full merge in either direction, and thus the common base
         that will be used for the next complete merge;
       the repository path and revision number of the tip of each branch.

  2. Print the revision numbers on SOURCE that have been merged to TARGET
     (with --show-revs=merged), or that have not been merged to TARGET
     (with --show-revs=eligible). Print only revisions in which there was
     at least one change in SOURCE.

     If --revision (-r) is provided, filter the displayed information to
     show only that which is associated with the revisions within the
     specified range. Revision numbers, dates, and the 'HEAD' keyword are
     valid range values.

  SOURCE and TARGET are the source and target branch URLs, respectively.
  (If a WC path is given, the corresponding base URL is used.) The default
  TARGET is the current working directory ('.'). REV specifies the revision
  to be considered the tip of the branch; the default for SOURCE is HEAD,
  and the default for TARGET is HEAD for a URL or BASE for a WC path.

  The depth can be 'empty' or 'infinity'; the default is 'empty'.
]]

With some simple scripting you should be able to run this on all branches
below a specific directory, etc.

Thanks / Met vriendelijke groeten,

        Bert
Received on 2017-02-22 10:14:36 CET

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.