Fix up help string for "stg clone"
[stgit] / stgit / git.py
index b6e47c3..0cdc125 100644 (file)
@@ -638,11 +638,11 @@ def apply_patch(filename = None, base = None):
                 return False
             return True
 
-    refresh_index()
-
     if base:
         orig_head = get_head()
         switch(base)
+    else:
+        refresh_index()         # needed since __apply_patch() doesn't do it
 
     if not __apply_patch():
         if base:
@@ -661,3 +661,11 @@ def clone(repository, local_dir):
     if __run('git clone', [repository, local_dir]) != 0:
         raise GitException, 'Failed "git clone %s %s"' \
               % (repository, local_dir)
+
+def modifying_revs(files, base_rev):
+    """Return the revisions from the list modifying the given files
+    """
+    cmd = ['git-rev-list', '%s..' % base_rev, '--']
+    revs = [line.strip() for line in _output_lines(cmd + files)]
+
+    return revs