Revision 2498
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
408 | 408 |
def next_version(name): |
409 | 409 |
'''Prepends the version # so it won't be removed if the name is truncated''' |
410 | 410 |
version = 1 # first existing name was version 0 |
411 |
match = re.match(r'^v(\d+)_(.*)$', name)
|
|
411 |
match = re.match(r'^#(\d+)-(.*)$', name)
|
|
412 | 412 |
if match: |
413 | 413 |
version = int(match.group(1))+1 |
414 | 414 |
name = match.group(2) |
415 |
return 'v'+str(version)+'_'+name
|
|
415 |
return '#'+str(version)+'-'+name
|
|
416 | 416 |
|
417 | 417 |
def run_query_into(db, query, params, into=None, *args, **kw_args): |
418 | 418 |
'''Outputs a query to a temp table. |
Also available in: Unified diff
sql.py: next_version(): Use special chars in version part of name string for clarity