设置标签 ‘svn’

在程序中获得当前app的svn版本号

给app的target添加编译脚本
svnv
注意Shell:栏是/usr/bin/python

#!/usr/bin/python

from AppKit import NSMutableDictionary
import os

def increaseVersion():
# reading svn version
version = os.popen('svnversion -n').read()

version = version.split(':')[-1]

if not version[-1].isdigit():
version = version[:-1]

# reading info.plist file
projectPlist = NSMutableDictionary.dictionaryWithContentsOfFile_('Info.plist')

# setting the svn version for CFBundleShortVersionString key
projectPlist['CFBundleShortVersionString'] = version
projectPlist.writeToFile_atomically_('Info.plist', True)

if __name__ == '__main__':
increaseVersion()

Upgrade SVN client to 1.6.4 on Mac OS X

If you get the following error:

svn: This client is too old to work with working copy ‘.’;please get a newer Subversion client

… or you just want to update your subversion client (command line), try the following:

1. Go to http://subversion.tigris.org/getting.html#osx
2. Download openCollabNet (Universal) version
3. Install the package
4. Change .bash_profile with introducing the following setup
export PATH=/opt/subversion/bin:$PATH

Del .svn version of directory

When you check in your working copy, you may get an error of “is under version control”, and can’t add the directory to your new version library , oaky, use this in your shell to delete all old .svn hided files then it gonna to be “clean” :

  1. cd/to/your/dir
  2. find . -type d -name “.svn”|xargs rm -rf
  3. Linux and unix-like only,if you use Windows,just use F3 and find all .svn and shift+del
回到顶部

关于我:

  • iPhone 开发者. 自由职业者.
  • 苹果忠实用户. 完美主义者.
  • Email/iChat/MSN/GTalk: i@imi.im
  • Twitter/Sina: @TraWor
  •  

    Switch to our mobile site