Fredrik Håård avatar Fredrik Håård committed e9ebd48

resolved #14 hg_log: cannot filter by branch

Comments (0)

Files changed (3)

         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:

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",
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.