Random Sequence

A Mercurial extension for use with XCode. Updates CFBundleVersionString when adding a tag to the repository.

Sponsored Links:

Mercurial avgtag Extension

What Is This?

It’s a replacement command for hg tag. This version updates the short bundle string in your Info.Plist, commits the change, then adds the tag.

Tested with Mercurial 1.3 on Mac OS X 10.5.7

Source

avgtag.py

#!/usr/bin/env python

from mercurial import (hg, repo, commands)
from subprocess import call
import os

def agvtag_cmd(ui, repo, tag, **opts):
    path = ui.config('agvtag', 'path', default=".", untrusted=False)
    os.chdir(path)
    call(['agvtool', 'new-marketing-version', tag]);
    node = repo.commit(text="Updates Bundle Version String (CFBundleVersionString) for tag "+tag)    
    commands.tag(ui, repo, tag)

cmdtable = {
    # "command-name": (function-call, options-list, help-string)
    "agvtag": (agvtag_cmd, [], "hg agvtag tag")
}

Installation

  1. Copy avgtag.py to your hgext directory. If you installed Mercurial on OS X 10.5 from a binary package, this is probably /Library/Python/2.5/site-packages/hgext/
  2. Add agvtag= to the extensions section of your ~/hgrc


[extensions]
agvtag =

Usage

hg agvtag "1.0b1"

Download

agvtag.py (548 B)

Sponsored Links: