During the French Revolution, the French National Assembly rewrote the criminal code in 1791, omitting all reference to homosexuality. During the Napoleonic wars, homosexuality was decriminalised in territories coming under French control, such as the Netherlands and many of the pre-unification German states; however, in Germany this ended with the unification of the country under the Prussian Kaiser, as Prussia had long punished homosexuality harshly. On 6 August 1942, the Vichy government made homosexual relations with anyone under twenty-one illegal as part of its conservative agenda. Most Vichy legislation was repealed after the war—but the anti-gay Vichy law remained on the books for four decades until it was finally repealed in August 1982 when the age of consent (15) was again made the same for heterosexual as well as homosexual partners.