chiark / gitweb /
Make Series.refresh_patch automatically save the undo information
authorCatalin Marinas <catalin.marinas@gmail.com>
Sat, 1 Dec 2007 22:59:59 +0000 (22:59 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Sat, 1 Dec 2007 22:59:59 +0000 (22:59 +0000)
The patch pushing with was losing the undo information because the arguments
passed to refresh_patch. The backup argument now defaults to True since
this is needed in most of the cases.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/commands/imprt.py
stgit/stack.py
t/t1202-push-undo.sh

index ec3ca9378e4ef2a5f269daf7ee11db0e27b45ad5..1c21a745280a4539a434d01a10a5b003226ea66d 100644 (file)
@@ -171,7 +171,8 @@ def __create_patch(filename, message, author_name, author_email,
             git.apply_patch(diff = diff)
         crt_series.refresh_patch(edit = options.edit,
                                  show_patch = options.showpatch,
-                                 sign_str = options.sign_str)
+                                 sign_str = options.sign_str,
+                                 backup = False)
         out.done()
 
 def __import_file(filename, options, patch = None):
index 7f167111a5061448839240d1e334c639ea7339ab..3139822680d10f8791dcc7e51e1ce2930bb199ce 100644 (file)
@@ -767,7 +767,7 @@ class Series(PatchSet):
                       author_name = None, author_email = None,
                       author_date = None,
                       committer_name = None, committer_email = None,
-                      backup = False, sign_str = None, log = 'refresh',
+                      backup = True, sign_str = None, log = 'refresh',
                       notes = None, bottom = None):
         """Generates a new commit for the topmost patch
         """
index 039103aec01229ee6da57d1a53a88ad59a175212..51ae138dea4d603e1be9dbd587da772b8aeb5054 100755 (executable)
@@ -52,4 +52,10 @@ test_expect_success \
        stg push --undo
        '
 
+test_expect_success \
+       'Check the push after undo fails as well' \
+       '
+       ! stg push bar
+       '
+
 test_done