<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def shelve(self, changelist=None):
 """Shelves the file if it is in a changelist :param changelist: Changelist to add the move to :type changelist: :class:`.Changelist` """

        if changelist is None and self.changelist.description == 'default':
            raise errors.ShelveError('Unabled to shelve files in the default changelist')

        cmd = ['shelve']
        if changelist:
            cmd += ['-c', str(changelist)]

        cmd.append(self.depotFile)

        self._connection.run(cmd)

        self.query()