@@ -44,20 +44,40 @@ def push(
44
44
self .scm .reset (hard = True )
45
45
return rev
46
46
47
- def pop (self ):
47
+ def pop (self , ** kwargs ):
48
+ """Pop the last stash commit.
49
+
50
+ Supports the same keyword arguments as apply().
51
+ """
48
52
logger .debug ("Popping from stash '%s'" , self .ref )
49
53
ref = f"{ self .ref } @{{0}}"
50
54
rev = self .scm .resolve_rev (ref )
51
55
try :
52
- self .apply (rev )
56
+ self .apply (rev , ** kwargs )
53
57
except Exception as exc :
54
58
raise SCMError ("Could not apply stash commit" ) from exc
55
59
self .drop ()
56
60
return rev
57
61
58
- def apply (self , rev ):
62
+ def apply (
63
+ self ,
64
+ rev : str ,
65
+ reinstate_index : bool = False ,
66
+ skip_conflicts : bool = False ,
67
+ ):
68
+ """Apply a stash commit.
69
+
70
+ Arguments:
71
+ rev: Stash commit to apply.
72
+ reinstate_index: If True, stashed index changes will be reapplied.
73
+ skip_conflicts: If True, conflicting changes will be skipped and
74
+ will not be applied from the stash. By default, apply will
75
+ fail if any conflicts are found.
76
+ """
59
77
logger .debug ("Applying stash commit '%s'" , rev )
60
- self .scm ._stash_apply (rev ) # pylint: disable=protected-access
78
+ self .scm ._stash_apply ( # pylint: disable=protected-access
79
+ rev , reinstate_index = reinstate_index , skip_conflicts = skip_conflicts
80
+ )
61
81
62
82
def drop (self , index : int = 0 ):
63
83
if index < 0 or index >= len (self ):
0 commit comments