JasonRight 发表于 2013-2-7 09:07:46

pysvn update with ignore_externals

svn ant task 的update不支持ignore_externals. pysvn 则可以
 
import osimport pysvndef notify(event_dict):    action = event_dict["action"]    path = event_dict["path"]    if action != pysvn.wc_notify_action.update_update \      and action != pysvn.wc_notify_action.update_completed:      print '%s %s' % (action, path)def updateWithIgnoreExternals(path):    client = pysvn.Client()    client.callback_notify = notify    for dirpath, dirnames, filenames in os.walk(path):      if '.svn' in dirnames:            print 'svn updating ' + dirpath            print client.update(dirpath, ignore_externals=True)            del dirnames[:]updateWithIgnoreExternals('/home/jason/svn')
页: [1]
查看完整版本: pysvn update with ignore_externals