Infrastructure for current directory handling
[stgit] / stgit / commands / id.py
index 4c07c4f..3e28f2f 100644 (file)
@@ -20,16 +20,20 @@ from optparse import OptionParser, make_option
 
 from stgit.commands.common import *
 from stgit.utils import *
+from stgit.out import *
 from stgit import stack, git
 
 
-help = 'print the hash value of a GIT id'
+help = 'print the GIT hash value of a StGIT reference'
 usage = """%prog [options] [id]
 
 Print the hash value of a GIT id (defaulting to HEAD). In addition to
 the standard GIT id's like heads and tags, this command also accepts
-'base' and '[<patch>]/(bottom | top)'."""
+'base[@<branch>]' and '[<patch>[@<branch>]][//[bottom | top]]'. If no
+'top' or 'bottom' are passed and <patch> is a valid patch name, 'top'
+will be used by default."""
 
+directory = DirectoryHasRepository()
 options = [make_option('-b', '--branch',
                        help = 'use BRANCH instead of the default one')]
 
@@ -44,4 +48,4 @@ def func(parser, options, args):
     else:
         parser.error('incorrect number of arguments')
 
-    print git_id(id_str, strict = True)
+    out.stdout(git_id(id_str))