changeset 215:b5d4d1552765

add some annotations for test coverage
author Abderrahim Kitouni <a.kitouni@gmail.com>
date Tue, 07 Jul 2009 17:46:14 +0100
parents 425ac5be04c2
children 8d961ea5fc5a
files git_handler.py gitrepo.py hgrepo.py
diffstat 3 files changed, 7 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/git_handler.py
+++ b/git_handler.py
@@ -245,7 +245,7 @@
             try:
                 timezone = format_timezone(-int(timezone))
                 commit['committer'] = '%s %s' % (name_timestamp, timezone)
-            except ValueError:
+            except ValueError: #pragma: no cover
                 self.ui.warn(_("Ignoring committer in extra, invalid timezone in r%d: '%s'.\n") % (ctx, timezone))
         if 'encoding' in extra:
             commit['encoding'] = extra['encoding']
@@ -608,7 +608,7 @@
                         else:
                             # XXX: maybe abort completely
                             ui.warn('not pushing branch %s, please merge'% head)
-                except RepoError:
+                except RepoError: #pragma: no cover
                     # remote_ref is not here
                     pass
 
@@ -698,7 +698,7 @@
         try:
             bms = bookmarks.parse(self.repo)
             return dict([(bm, self.map_git_get(hex(bms[bm]))) for bm in bms])
-        except AttributeError:
+        except AttributeError: #pragma: no cover
             return {}
 
     def import_tags(self, refs):
@@ -831,11 +831,7 @@
         from dulwich.client import TCPGitClient, SSHGitClient, SubprocessGitClient
         for handler, transport in (("git://", TCPGitClient), ("git@", SSHGitClient), ("git+ssh://", SSHGitClient)):
             if uri.startswith(handler):
-                if handler == 'git@':
-                    host, path = uri[len(handler):].split(":", 1)
-                    host = 'git@' + host
-                else:
-                    host, path = uri[len(handler):].split("/", 1)
+                host, path = uri[len(handler):].split("/", 1)
                 return transport(host), '/' + path
         # if its not git or git+ssh, try a local url..
         return SubprocessGitClient(), uri
--- a/gitrepo.py
+++ b/gitrepo.py
@@ -4,7 +4,7 @@
 class gitrepo(repo.repository):
     capabilities = []
     def __init__(self, ui, path, create):
-        if create:
+        if create: # pragma: no cover
             raise util.Abort('Cannot create a git repository.')
         self.path = path
 
--- a/hgrepo.py
+++ b/hgrepo.py
@@ -136,14 +136,14 @@
             if isinstance(remote, gitrepo):
                 git = GitHandler(self, self.ui)
                 git.fetch(remote.path)
-            else:
+            else: #pragma: no cover
                 super(hgrepo, self).pull(remote, heads, force)
 
         def push(self, remote, force=False, revs=None):
             if isinstance(remote, gitrepo):
                 git = GitHandler(self, self.ui)
                 git.push(remote.path)
-            else:
+            else: #pragma: no cover
                 super(hgrepo, self).push(remote, force, revs)
 
         def tags(self):