Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2007-11-30 18:10:27

Eric Niebler wrote:
> Beman Dawes wrote:
>> Beman Dawes wrote:
>>> Until further notice, branches/release is open for known-good merges.
>>> "known-good" means changes that are already passing trunk regression
>>> tests, or are in files like documentation that have no effect on testing.
> Apparently, some of us morons need more help with this crazy merge
> thing. I need to merge revisions 41419-41420 from trunk to release, so I
> did what seemed the most logical thing:
> svn co
> cd release
> merge -r 41419-41420
> The invocation does *nothing* ... no merge, no output, no
> errors. Any help?

Because I always want all my trunk changes merged into branches/release,
I'm not using, and am doing a tree-to-tree rather than
revsion-to-revision merge.

Also, I don't want to have to do multiple merges for
boost-root/libs/library-name, boost-root/boost/library-name, and then
also individual header files in boost-root//boost, I use a script to
automate merges. See attached. The script requires environmental
variable BOOST_MERGED_TO_RELEASE be a path to the current trunk, and the
current branches/release also checked out, say in /boost/release.


   cd /boost/release
   merge_release --dry-run filesystem

will do a dry run of the merge. You can then do:

   merge_release filesystem

for the actual merge. Then after local testing, the commit is done normally.

Below is what it looked like for a merge I just did. Note the message
giving the revision number, which I use in the commit message.

HTH, even if it doesn't directly answer your question.


D:\>cd \boost\release

D:\boost\release> filesystem
command: svn info --xml d:\boost\merged-to-release
Using d:\boost\merged-to-release revision 41517 as trunk merge point
Merging boost-root/boost/ filesystem ...

command: svn merge

Merging boost-root/libs/ filesystem ...

command: svn merge
U libs/filesystem/doc/index.htm
U libs/filesystem/src/path.cpp
A libs/filesystem/example/vc++.bat
U libs/filesystem/example/simple_ls.cpp
U libs/filesystem/example/file_size.cpp

command: svn merge

# merge diff between branches/release and trunk into working copy

# Copyright Beman Dawes 2007

# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at

# ---------------------------------------------------------------------------- #

import os
import sys
import platform
import time
import ftplib

# invoke the system command line processor
def cmd(command):
  print "command:", command
# get revision number of a path, which may be a filesystem path or URL
def revision(path, results_path, test_name):
  rev = 0
  svn_info_file = results_path + "/" + test_name + "-svn_info.xml"
  command = "svn info --xml " + path + " >" + svn_info_file
  f = open( svn_info_file, 'r' )
  svn_info =
  i = svn_info.find( 'revision=' )
  if i >= 0:
    i += 10
    while svn_info[i] >= '0' and svn_info[i] <= '9':
      rev = rev*10 + int(svn_info[i])
      i += 1
  return rev

# invoke svn merge
def svn_merge(options, path, trunk_rev):
  cmd("svn merge "+options+""
    +path+""+path+"@"+str(trunk_rev)+" "+path)

# ---------------------------------------------------------------------------- #

if len(sys.argv) < 2:
  print "Usage: [options] LIBRARY-NAME"
  print " Does svn merge to release from trunk for any boost-root/boost"
  print " headers associated with the library, the boost/LIBRARY-NAME directory"
  print " and the libs/LIBRARY-NAME directory. Options are the svn merge options."
  print "Example: --dry-run filesystem"

if not os.path.exists("LICENSE_1_0.txt") or not os.path.exists("libs") or not os.path.exists("boost"):
  print "Error: This program must run from the boost-root directory"

options = ""
i = 1
while i < len(sys.argv)-1:
  options += sys.argv[i]+" "
  i += 1
library_name = sys.argv[i]

trunk_merged_to_release = os.environ['BOOST_MERGED_TO_RELEASE']
if len(trunk_merged_to_release) == 0:
  print "Error: Must set BOOST_MERGED_TO_RELEASE to trunk path"

trunk_revision = revision(trunk_merged_to_release, os.environ['TEMP'], 'merged_to_release')
print "Using", trunk_merged_to_release, "revision", trunk_revision, "as trunk merge point"

print "Merging boost-root/boost/", library_name, "..."
svn_merge(options, "boost/" + library_name, trunk_revision)

print "Merging boost-root/libs/", library_name, "..."
svn_merge(options, "libs/" + library_name, trunk_revision)

grepcmd = "grep -E -l \""+library_name+"([ /]|$)\" boost/*.h*"

#print "Searching headers with", grepcmd
for hdr in os.popen(grepcmd).readlines():
  svn_merge(options, hdr[0:len(hdr)-1], trunk_revision)

Boost list run by bdawes at, gregod at, cpdaniel at, john at