##// END OF EJS Templates
githelp: fail gracefully in a couple cases where arguments are missing...
Matt Harbison -
r38130:d8bd6a9c default
parent child Browse files
Show More
@@ -236,6 +236,8 b' def branch(ui, repo, *args, **kwargs):'
236 # shell command to output the active bookmark for the active
236 # shell command to output the active bookmark for the active
237 # revision
237 # revision
238 old = '`hg log -T"{activebookmark}" -r .`'
238 old = '`hg log -T"{activebookmark}" -r .`'
239 else:
240 raise error.Abort(_('missing newbranch argument'))
239 new = args[0]
241 new = args[0]
240 cmd['-m'] = old
242 cmd['-m'] = old
241 cmd.append(new)
243 cmd.append(new)
@@ -957,6 +959,8 b' def status(ui, repo, *args, **kwargs):'
957 ui.status((bytes(cmd)), "\n")
959 ui.status((bytes(cmd)), "\n")
958
960
959 def svn(ui, repo, *args, **kwargs):
961 def svn(ui, repo, *args, **kwargs):
962 if not args:
963 raise error.Abort(_('missing svn command'))
960 svncmd = args[0]
964 svncmd = args[0]
961 if not svncmd in gitsvncommands:
965 if not svncmd in gitsvncommands:
962 ui.warn(_("error: unknown git svn command %s\n") % (svncmd))
966 ui.warn(_("error: unknown git svn command %s\n") % (svncmd))
@@ -988,6 +992,9 b' def svnfindrev(ui, repo, *args, **kwargs'
988 ]
992 ]
989 args, opts = parseoptions(ui, cmdoptions, args)
993 args, opts = parseoptions(ui, cmdoptions, args)
990
994
995 if not args:
996 raise error.Abort(_('missing find-rev argument'))
997
991 cmd = Command('log')
998 cmd = Command('log')
992 cmd['-r'] = args[0]
999 cmd['-r'] = args[0]
993
1000
@@ -1020,6 +1027,10 b' def tag(ui, repo, *args, **kwargs):'
1020 cmd = Command('tags')
1027 cmd = Command('tags')
1021 else:
1028 else:
1022 cmd = Command('tag')
1029 cmd = Command('tag')
1030
1031 if not args:
1032 raise error.Abort(_('missing tag argument'))
1033
1023 cmd.append(args[0])
1034 cmd.append(args[0])
1024 if len(args) > 1:
1035 if len(args) > 1:
1025 cmd['-r'] = args[1]
1036 cmd['-r'] = args[1]
General Comments 0
You need to be logged in to leave comments. Login now