svn ant task 的update 不支持ignore_externals. pysvn 则可以
import os
import pysvn
def 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')