code: def log(self, n=None, **kwargs):
          
          cmd = ['hg', 'log']
          if n:
              cmd.extend('-l%d' % n)
          cmd.extend(
              (('--%s=%s' % (k, v)) for (k, v)
                  in iteritems(kwargs))
          )
          return self.sh(cmd, shell=False)
docs: Run the repository log command
  
          Returns:
              str: output of log command (``hg log -l <n> <--kwarg=value>``)