The disjunction operator in bash ||can execute this scenario: try executing the first command if the second command fails, if it fails to return the error code. Specifically for this question,
hg update || hg clone <source>
; , . , .
, .
?
>/dev/null; 2>/dev/null; .