Commits

Fredrik Håård  committed e9ebd48

resolved #14 hg_log: cannot filter by branch

  • Participants
  • Parent commits d949c28

Comments (0)

Files changed (3)

File hgapi/hgapi.py

         args = [arg for arg in args if arg]
         self.hg_command("commit", "-m", message, *args)
 
-    def hg_log(self, identifier=None, limit=None, template=None, **kwargs):
+    def hg_log(self, identifier=None, limit=None, template=None, branch=None, **kwargs):
         """Get repositiory log."""
         cmds = ["log"]
         if identifier: cmds += ['-r', str(identifier)]
+        if branch: cmds += ['-b', str(branch)]
         if limit: cmds += ['-l', str(limit)]
         if template: cmds += ['--template', str(template)]
         if kwargs:

File hgapi/testhgapi.py

             'mytag2': self.repo[1].node,
             'tip': self.repo[-1].node})
 
+    def test_220_LogWithBranch(self):
+        default = self.repo.hg_log(branch='default')
+        branch = self.repo.hg_log(branch='test_branch')
+
+        self.assertTrue("commit test_branch" in branch)
+        self.assertFalse("commit test_branch" in default)
 
 def test_doc():
     #Prepare for doctest
 
 setup(
     name = "hgapi",
-    version = "1.3.1a2",
+    version = "1.3.1a3",
     packages = ['hgapi'],
     test_suite = "hgapi.testhgapi.TestHgAPI",
     author = "Fredrik Håård",