Inside they found 58 grams of cocaine and 60 grams of heroin worth a total of £6,480 along with the defendant and Shakira Moss, 19.

"What they had clearly walked in on was an insurgent drug dealer's drug operation," he told the court.

"Mr Cumberbatch, from London, he had come to Swindon to exploit perhaps a softer market.

"He had used Shakira Moss to run the drug line, a phone from which Miss Moss was running the drugs, delivering the drugs, and Mr Cumberbatch was running her. It was clear from text messages to her."

Mr Welling said the defendant's own mobile also contained texts in which he boasted about the amount of money he was making.

He told a friend he was taking £450 a day selling £10 deals without offering any discount for users buying in bulk.

Mr Welling said adding the stock he had when he was arrested to what he said he was making over the 54 days of texts would total £24,300.

He told the court that the sums involved could push the case into a higher category in the sentencing guidelines.

Cumberbatch, of Colindale, north London, admitted two counts of possessing drugs with intent to supply.

The court heard he was put on a detention and training order at the youth court for a similar matter in 2011.

Angela Shaw, defending, said her client realised he was facing a lengthy jail term and fell into dealing after finding it hard to get work with his previous convictions.

She said his text messages should not be used as proof that he was making large sums of money as there was no evidence the boasts were correct.

Jailing him Judge Douglas Field said: "You came down from London to try your hand at drug dealing in Swindon and St Ives Court was the scene of the operation and you were certainly playing a significant role.

"You were running your co-defendant Miss Moss and you were taking large sums by way of profit.

"I am not placing you in category three as a result of what your boasting was, that you were making £450 a day.

"I am placing you in category three because that was the overall picture painted by the drugs seized on the day and all the paraphernalia, your DNA on packaging and the scales. It is aggravated by your previous conviction."

He also imposed an ASBO banning him from having more than one mobile, or one not registered in his name, for 10 years.

Moss, of Church Place, Railway Village, was put on a two year suspended sentence at an earlier hearing after admitting the same charges.