mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 14:58:03 +03:00
Show proper error message on missing snapshot id
Summary: Currently, using `hg snapshot show` without a snapshot id, simply crashes. This diff makes it exit with a better message. Reviewed By: markbt Differential Revision: D33185824 fbshipit-source-id: c2eaf98623416ae7de3dc4221c601f9fd47f5fd4
This commit is contained in:
parent
a5978edae1
commit
b29cec3f50
@ -10,7 +10,9 @@ from .createremote import parsemaxuntracked
|
|||||||
from .latest import _isworkingcopy
|
from .latest import _isworkingcopy
|
||||||
|
|
||||||
|
|
||||||
def cmd(ui, repo, csid, **opts):
|
def cmd(ui, repo, csid=None, **opts):
|
||||||
|
if csid is None:
|
||||||
|
raise error.CommandError("snapshot isworkingcopy", _("missing snapshot id"))
|
||||||
try:
|
try:
|
||||||
snapshot = repo.edenapi.fetchsnapshot(
|
snapshot = repo.edenapi.fetchsnapshot(
|
||||||
{
|
{
|
||||||
|
@ -74,7 +74,9 @@ def _snapshot2ctx(repo, snapshot):
|
|||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
|
|
||||||
def show(ui, repo, csid, **opts):
|
def show(ui, repo, csid=None, **opts):
|
||||||
|
if csid is None:
|
||||||
|
raise error.CommandError("snapshot show", _("missing snapshot id"))
|
||||||
try:
|
try:
|
||||||
snapshot = repo.edenapi.fetchsnapshot(
|
snapshot = repo.edenapi.fetchsnapshot(
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user