Skip to content

Instantly share code, notes, and snippets.

@yuanchuan
Created July 19, 2011 07:01
Show Gist options
  • Save yuanchuan/1091528 to your computer and use it in GitHub Desktop.
Save yuanchuan/1091528 to your computer and use it in GitHub Desktop.
更新并显示日志
#不想每次用TortoiseSVN 时都用鼠标右击更新
import os
import sys
def run_command(commands):
op_os = lambda x: os.system(x)
op_ms = lambda x: sys.stdout.write(x+'\n')
for cmd in commands:
c = cmd.split('>')
{'os': op_os, 'ms': op_ms}[c[0]](c[1])
svn_path = 'e:\\ProjectHL'
run_command([
'ms>fetching..',
'os>svn update ' + svn_path,
'ms>LOG -3',
'os>svn log -l 3 ' + svn_path,
'os>pause'
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment