Green’s Dictionary of Slang

polly n.2

In phrases

doing polly [ety. unknown]

(Aus./UK prison) picking oakum.

[US]Matsell Vocabulum.
[Aus]Crowe Aus. Sl. Dict. 24: Doing Polly, picking oakum in gaol.
[Aus]Argus (Melbourne) 20 Sept. 6/4: In doing Polly or diamond cracking [...] picking oakum and breaking stones [he] passes the leaden days.