Commons vote forces government to publish Brexit legal advice ahead of vote