##// END OF EJS Templates
githelp: translate git stash show and clear actions and --patch flag...
av6 -
r42589:7752cd3a default
parent child Browse files
Show More
@@ -923,6 +923,7 def show(ui, repo, *args, **kwargs):
923
923
924 def stash(ui, repo, *args, **kwargs):
924 def stash(ui, repo, *args, **kwargs):
925 cmdoptions = [
925 cmdoptions = [
926 ('p', 'patch', None, ''),
926 ]
927 ]
927 args, opts = parseoptions(ui, cmdoptions, args)
928 args, opts = parseoptions(ui, cmdoptions, args)
928
929
@@ -931,6 +932,17 def stash(ui, repo, *args, **kwargs):
931
932
932 if action == 'list':
933 if action == 'list':
933 cmd['-l'] = None
934 cmd['-l'] = None
935 if opts.get('patch'):
936 cmd['-p'] = None
937 elif action == 'show':
938 if opts.get('patch'):
939 cmd['-p'] = None
940 else:
941 cmd['--stat'] = None
942 if len(args) > 1:
943 cmd.append(args[1])
944 elif action == 'clear':
945 cmd['--cleanup'] = None
934 elif action == 'drop':
946 elif action == 'drop':
935 cmd['-d'] = None
947 cmd['-d'] = None
936 if len(args) > 1:
948 if len(args) > 1:
@@ -943,10 +955,9 def stash(ui, repo, *args, **kwargs):
943 cmd.append(args[1])
955 cmd.append(args[1])
944 if action == 'apply':
956 if action == 'apply':
945 cmd['--keep'] = None
957 cmd['--keep'] = None
946 elif (action == 'branch' or action == 'show' or action == 'clear'
958 elif action == 'branch' or action == 'create':
947 or action == 'create'):
948 ui.status(_("note: Mercurial doesn't have equivalents to the "
959 ui.status(_("note: Mercurial doesn't have equivalents to the "
949 "git stash branch, show, clear, or create actions\n\n"))
960 "git stash branch or create actions\n\n"))
950 return
961 return
951 else:
962 else:
952 if len(args) > 0:
963 if len(args) > 0:
@@ -219,6 +219,22 githelp for stash drop with name
219 $ hg githelp -- git stash drop xyz
219 $ hg githelp -- git stash drop xyz
220 hg shelve -d xyz
220 hg shelve -d xyz
221
221
222 githelp for stash list with patch
223 $ hg githelp -- git stash list -p
224 hg shelve -l -p
225
226 githelp for stash show
227 $ hg githelp -- git stash show
228 hg shelve --stat
229
230 githelp for stash show with patch and name
231 $ hg githelp -- git stash show -p mystash
232 hg shelve -p mystash
233
234 githelp for stash clear
235 $ hg githelp -- git stash clear
236 hg shelve --cleanup
237
222 githelp for whatchanged should show deprecated message
238 githelp for whatchanged should show deprecated message
223 $ hg githelp -- whatchanged -p
239 $ hg githelp -- whatchanged -p
224 this command has been deprecated in the git project, thus isn't supported by this tool
240 this command has been deprecated in the git project, thus isn't supported by this tool
General Comments 0
You need to be logged in to leave comments. Login now