<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,7 +8,7 @@ which in turn needs access to this version information.)
 
 VERSION = (0, 9, 0, 'alpha', 3)
 
-def get_version(verbose=False):
+def get_version(verbose=False, line_only=False):
     &quot;&quot;&quot;
     Return a version string for this package, based on `VERSION`.
 
@@ -18,10 +18,16 @@ def get_version(verbose=False):
     When ``verbose`` is True, a slightly more human-readable version is
     produced, e.g. '0.9 alpha 2'.
 
+    When ``line_only`` is True, only the major and minor version numbers are
+    returned, e.g. '0.9'.
+
     This code is based off of Django's similar version output algorithm.
     &quot;&quot;&quot;
     # Major + minor only
     version = '%s.%s' % (VERSION[0], VERSION[1])
+    # Break off now if we only want the line of development
+    if line_only:
+        return version
     # Append tertiary/patch if non-zero
     if VERSION[2]:
         version = '%s.%s' % (version, VERSION[2])</diff>
      <filename>fabric/version.py</filename>
    </modified>
    <modified>
      <diff>@@ -8,12 +8,14 @@ import fabric.version
 
 
 def test_get_version():
-    for version, version_str, verbose_version_str in [
-        ((0, 2, 0, 'final'), '0.2', '0.2 final'),
-        ((0, 2, 1, 'final'), '0.2.1', '0.2.1 final'),
-        ((0, 2, 0, 'alpha', 1), '0.2a1', '0.2 alpha 1'),
-        ((0, 2, 1, 'beta', 1), '0.2.1b1', '0.2.1 beta 1')
+    get_version = fabric.version.get_version
+    for tup, regular_str, verbose_str, line_str in [
+        ((0, 9, 0, 'final'), '0.9', '0.9 final', '0.9'),
+        ((0, 9, 1, 'final'), '0.9.1', '0.9.1 final', '0.9'),
+        ((0, 9, 0, 'alpha', 1), '0.9a1', '0.9 alpha 1', '0.9'),
+        ((0, 9, 1, 'beta', 1), '0.9.1b1', '0.9.1 beta 1', '0.9')
     ]:
-        fabric.version.VERSION = version
-        yield eq_, fabric.version.get_version(), version_str
-        yield eq_, fabric.version.get_version(verbose=True), verbose_version_str
+        fabric.version.VERSION = tup
+        yield eq_, get_version(), regular_str
+        yield eq_, get_version(verbose=True), verbose_str
+        yield eq_, get_version(line_only=True), line_str</diff>
      <filename>tests/test_version.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>91aa2204d0a8f92a5762e4492f3880880aee0717</id>
    </parent>
  </parents>
  <author>
    <name>Jeff Forcier</name>
    <email>jeff@bitprophet.org</email>
  </author>
  <url>http://github.com/karmazilla/fabric/commit/d7845bc77bd08d8ae8710fa1fe5cb55647ad3dd6</url>
  <id>d7845bc77bd08d8ae8710fa1fe5cb55647ad3dd6</id>
  <committed-date>2009-07-02T19:43:27-07:00</committed-date>
  <authored-date>2009-07-02T19:43:27-07:00</authored-date>
  <message>Add &quot;line_only&quot; option to get_version().

Also update test to match, and tweaked version numbers to be more up to
date. Not like that really matters, of course, but there never was a
Fabric 0.2...</message>
  <tree>5748ae1570284aa0ef7c5b066b2785ca4beb9925</tree>
  <committer>
    <name>Jeff Forcier</name>
    <email>jeff@bitprophet.org</email>
  </committer>
</commit>
