Changes between Version 13 and Version 14 of MercurialBranches


Ignore:
Timestamp:
Dec 3, 2010, 10:36:15 PM (14 years ago)
Author:
Russell Keith-Magee
Comment:

Overcame my own laziness and made branch detection automatic in my version of the backport script

Legend:

Unmodified
Added
Removed
Modified
  • MercurialBranches

    v13 v14  
    8686
    8787print
     88branch = os.environ.get('DJANGO_BRANCH',None)
     89if branch is None:
     90    branch = raw_input('Backport branch: ')
     91else:
     92    print "Backport branch:", branch
     93
    8894msg_file = open(msg, 'r')
    8995outlines = []
     
    97103            firstline = False
    98104            print 'MERGING: %s' % line
    99             outlines.append('[1.2.X] %s' % line)
     105            outlines.append('[%s] %s' % (branch, line))
    100106    else:
    101107        outlines.append(line)
     
    123129{{{
    124130#!sh
    125 #!/bin/bash
    126131export SVNMERGE_REVISION=`hg svn info -r $1 | egrep '^Revision' | cut -f 2 -d ' '`
    127 hg transplant $1 --filter /path/to/backport.py
     132export DJANGO_BRANCH=`hg branch | cut -f 2 -d '/'`
     133hg transplant $1 --filter commit.py
    128134unset SVNMERGE_REVISION
     135unset DJANGO_BRANCH
    129136}}}
    130137
     
    142149}}}
    143150
    144 This script needs to be manually updated after every release, because the [1.2.X] string is hardcoded. This is mostly due to my (Russell's) own laziness -- it would be trivial to update the script to pull the branch identifier from the output of `hg branch`.
    145 
    146151=== Gotchas ===
    147152
Back to Top