comparison scripts/beta-notify/notify-roundup.py @ 4164:6750b2dae53e gsoc-2009

Did some work on hg support
author Pygi <pygi@users.sourceforge.net>
date Thu, 02 Jul 2009 17:57:27 +0000
parents 5d8246ac6e89
children
comparison
equal deleted inserted replaced
4163:d31b4c4e1945 4164:6750b2dae53e
45 # command-line args 45 # command-line args
46 cfg = ConfigParser.ConfigParser() 46 cfg = ConfigParser.ConfigParser()
47 cfg.read(sys.argv[1]) 47 cfg.read(sys.argv[1])
48 repos_dir = sys.argv[2] 48 repos_dir = sys.argv[2]
49 revision = int(sys.argv[3]) 49 revision = int(sys.argv[3])
50 50
51 # get a handle on the revision in the repository 51 vcs_type = cfg.get('vcs', 'type')
52 repos = Repository(repos_dir, revision, pool) 52
53 53 # get a handle on the revision in the VCS repository
54 if vcs_type == 'svn':
55 repos = SVNRepository(repos_dir, revision, pool)
56 elif vcs_type == 'hg':
57 repos = HGRepository(repos_dir, revision, pool)
58 else:
59 logging.error('we currently don\'t support %s VCS type'%vcs_type)
60
54 repos.klass = cfg.get('main', 'item-class') 61 repos.klass = cfg.get('main', 'item-class')
55 if not repos.extract_info(): 62 if not repos.extract_info():
56 return 63 return
57 64
58 if cfg.has_option('main', 'host'): 65 if cfg.has_option('main', 'host'):
235 else: 242 else:
236 text = ' unchanged' 243 text = ' unchanged'
237 output.write(' - copied%s from r%d, %s%s\n' 244 output.write(' - copied%s from r%d, %s%s\n'
238 % (text, change.base_rev, change.base_path[1:], is_dir)) 245 % (text, change.base_rev, change.base_path[1:], is_dir))
239 246
240 class Repository: 247 class HGRepository:
241 '''Hold roots and other information about the repository. From mailer.py 248 '''Holds roots and other information about the hg repository.'
249 '''
250
251 def __init__(self,repos_dir,rev,pool):
252 pass
253
254 class SVNRepository:
255 '''Hold roots and other information about the svn repository. From mailer.py
242 ''' 256 '''
243 def __init__(self, repos_dir, rev, pool): 257 def __init__(self, repos_dir, rev, pool):
244 self.repos_dir = repos_dir 258 self.repos_dir = repos_dir
245 self.rev = rev 259 self.rev = rev
246 self.pool = pool 260 self.pool = pool

Roundup Issue Tracker: http://roundup-tracker.org/