How to check which branches have specific commit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to check which branches have specific commit

Thijs de Ridder
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)


Best Regards,
Thijs de Ridder


Reply | Threaded
Open this post in threaded view
|

RE: How to check which branches have specific commit

Bert Huijben-5


> -----Original Message-----
> From: Thijs de Ridder [mailto:[hidden email]]
> Sent: woensdag 22 februari 2017 10:10
> To: [hidden email]
> 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


Reply | Threaded
Open this post in threaded view
|

RE: How to check which branches have specific commit

Thijs de Ridder
Thanks for the quick response. That was not the answer I was hoping for, but
at least with some scripting we will be able to automate the process.

Thanks

Thijs de Ridder

-----Oorspronkelijk bericht-----
Van: Bert Huijben [mailto:[hidden email]]
Verzonden: woensdag 22 februari 2017 10:14
Aan: 'Thijs de Ridder' <[hidden email]>;
[hidden email]
Onderwerp: RE: How to check which branches have specific commit



> -----Original Message-----
> From: Thijs de Ridder [mailto:[hidden email]]
> Sent: woensdag 22 februari 2017 10:10
> To: [hidden email]
> 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