Mercurial > hg-git
diff hggit/util.py @ 1115:8ed6c0cae9b8
cleanup: add some blank lines
author | Sean Farley <sean@farley.io> |
---|---|
date | Mon, 27 Nov 2017 18:46:07 -0500 |
parents | 21264429a8d4 |
children | 6141895a53c9 |
line wrap: on
line diff
--- a/hggit/util.py Mon Nov 27 18:34:24 2017 -0500 +++ b/hggit/util.py Mon Nov 27 18:46:07 2017 -0500 @@ -18,6 +18,7 @@ gitschemes = ('git', 'git+ssh', 'git+http', 'git+https') + def parse_hgsub(lines): """Fills OrderedDict with hgsub file content passed as list of lines""" rv = OrderedDict() @@ -29,10 +30,12 @@ rv[name.strip()] = value.strip() return rv + def serialize_hgsub(data): """Produces a string from OrderedDict hgsub content""" return ''.join(['%s = %s\n' % (n, v) for n, v in data.iteritems()]) + def parse_hgsubstate(lines): """Fills OrderedDict with hgsubtate file content passed as list of lines""" rv = OrderedDict() @@ -44,10 +47,12 @@ rv[name.strip()] = value.strip() return rv + def serialize_hgsubstate(data): """Produces a string from OrderedDict hgsubstate content""" return ''.join(['%s %s\n' % (data[n], n) for n in sorted(data)]) + def transform_notgit(f): '''use as a decorator around functions that call into dulwich''' def inner(*args, **kwargs): @@ -57,6 +62,7 @@ raise hgutil.Abort('not a git repository') return inner + def isgitsshuri(uri): """Method that returns True if a uri looks like git-style uri @@ -97,6 +103,7 @@ return True return False + def updatebookmarks(repo, changes, name='git_handler'): """abstract writing bookmarks for backwards compatibility""" bms = repo._bookmarks @@ -123,6 +130,7 @@ finally: lockmod.release(tr, lock, wlock) + def checksafessh(host): """check if a hostname is a potentially unsafe ssh exploit (SEC)