Mercurial > hgsubversion
comparison hgsubversion/__init__.py @ 1558:ae572c9be4e6
cleanup: remove lots of dead imports and code found by pyflakes
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Sat, 24 Mar 2018 17:04:19 -0400 |
parents | cff81f35b31e |
children | 0099cf9a9a8b |
comparison
equal
deleted
inserted
replaced
1557:dd409375c261 | 1558:ae572c9be4e6 |
---|---|
16 ''' | 16 ''' |
17 | 17 |
18 testedwith = '3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4' | 18 testedwith = '3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4' |
19 | 19 |
20 import os | 20 import os |
21 import sys | |
22 import traceback | |
23 | 21 |
24 from mercurial import commands | 22 from mercurial import commands |
25 try: | 23 try: |
26 from mercurial import exchange | 24 from mercurial import exchange |
27 exchange.push # existed in first iteration of this file | 25 exchange.push # existed in first iteration of this file |
366 def svnuuidkw(**args): | 364 def svnuuidkw(**args): |
367 """:svnuuid: String. Converted subversion revision repository identifier.""" | 365 """:svnuuid: String. Converted subversion revision repository identifier.""" |
368 return _templatehelper(args['ctx'], 'svnuuid') | 366 return _templatehelper(args['ctx'], 'svnuuid') |
369 | 367 |
370 loadkeyword(templatekeyword) | 368 loadkeyword(templatekeyword) |
371 | |
372 def listsvnkeys(repo): | |
373 keys = {} | |
374 repo = repo.local() | |
375 metadir = os.path.join(repo.path, 'svn') | |
376 | |
377 if util.subversionmetaexists(repo.path): | |
378 w = repo.wlock() | |
379 try: | |
380 for key in util.pushkeyfiles: | |
381 fullpath = os.path.join(metadir, key) | |
382 if os.path.isfile(fullpath): | |
383 data = open(fullpath).read() | |
384 | |
385 # Some of the files could be large, but also quite compressible | |
386 keys[key] = base85.b85encode(zlib.compress(data)) | |
387 finally: | |
388 w.release() | |
389 | |
390 return keys |