Add a --version=... option to the mail command
[stgit] / stgit / commands / common.py
index 293bd2e..86f62fb 100644 (file)
@@ -31,7 +31,7 @@ class CmdException(Exception):
 
 
 # Utility functions
-def git_id(string):
+def git_id(string, strict = False):
     """Return the GIT id
     """
     if not string:
@@ -53,6 +53,10 @@ def git_id(string):
             id_file = os.path.join(path, git_id)
             if os.path.isfile(id_file):
                 return read_string(id_file)
+
+        # maybe GIT knows more about this id
+        if not strict:
+            return git_id
     elif len(string_list) == 2:
         patch_name = string_list[0]
         if patch_name == '':
@@ -96,7 +100,7 @@ def print_crt_patch():
         print 'No patches applied'
 
 def resolved(filename):
-    git.update_cache([filename])
+    git.update_cache([filename], force = True)
     for ext in ['.local', '.older', '.remote']:
         fn = filename + ext
         if os.path.isfile(fn):