def find_revision_number(self, revision=None):
<EOL>self.create()<EOL>revision = revision or self.default_revision<EOL>output = self.context.capture('<STR_LIT>', '<STR_LIT>', '<STR_LIT>' % revision, '<STR_LIT>')<EOL>revision_number = len([line for line in output.splitlines() if not is_empty_line(line)])<EOL>if not (revision_number > <NUM_LIT:0>):<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise EnvironmentError(msg)<EOL><DEDENT>return revision_number<EOL>
Find the local revision number of the given revision.

.. note:: Bazaar has the concept of dotted revision numbers:

           For revisions which have been merged into a branch, a dotted
           notation is used (e.g., 3112.1.5). Dotted revision numbers
           have three numbers. The first number indicates what mainline
           revision change is derived from. The second number is the
           branch counter. There can be many branches derived from the
           same revision, so they all get a unique number. The third
           number is the number of revisions since the branch started.
           For example, 3112.1.5 is the first branch from revision
           3112, the fifth revision on that branch.

           (From http://doc.bazaar.canonical.com/bzr.2.6/en/user-guide/zen.html#understanding-revision-numbers)

          However we really just want to give a bare integer to our
          callers. It doesn't have to be globally accurate, but it
          should increase as new commits are made. Below is the
          equivalent of the git implementation for Bazaar.