Ticket #3361: svnsync.diff
| File svnsync.diff, 1.9 kB (added by anonymous, 6 months ago) |
|---|
-
H:/Desktop/Neuer
old new 33 33 f = file(filename, 'w') 34 34 print >> f, '#!/bin/sh' 35 35 f.close() 36 sh('chmod', '+x', filename) 37 38 if os.name == 'nt': 39 filename = os.path.join(directory, 'hooks', 'pre-revprop-change.bat') 40 f = file(filename, 'w') 41 print >> f, '' 42 f.close() 36 43 37 44 # XXX only works if chmod on the path; 38 45 # this should retrieve the file permissions and then 39 46 # set them appropriate with os.chmod 40 47 sh('chmod', '+x', filename) 41 48 42 ### initialize the sync 43 49 ### initialize the sync 44 50 return sh('svnsync', 'init', '--username', username, 45 'file://%s' % os.path.abspath(directory),51 get_osfilepath(directory), 46 52 repository) 47 53 48 54 def sync(directory, repository, username='svnsync'): … … 56 62 retval = create(directory, repository, username) 57 63 if retval[-1] != 0: 58 64 return retval 59 60 repo = 'file://%s' % os.path.abspath(directory) 65 repo = get_osfilepath(directory) 61 66 62 67 # ensure that the repository is pointed at the right place 63 68 propget = sh('svn', 'propget', 'svn:sync-from-url', '--revprop', '-r', '0', repo) … … 71 76 sync(directory, repository, username) 72 77 73 78 return sh('svnsync', 'sync', repo) 79 80 def get_osfilepath(directory): 81 if os.name == 'nt': 82 syncpath = 'file:///' + os.path.abspath(directory) 83 syncpath = syncpath.replace('\\','/') 84 else: 85 syncpath = 'file://' + os.path.abspath(directory) 86 return syncpath 74 87 75 88 if __name__ == '__main__': 76 89 import optparse
