The official text
Old and new, side by side
Indian Penal Code, 1860
Section 139 Persons subject to certain Acts
No person subject to the Army Act, the Army Act, 1950 (46 of 1950), the Naval Discipline Act, the Indian Navy (Discipline) Act, 1934 (34 of 1934), the Air Force Act or the Air Force Act, 1950 (45 of 1950), is subject to punishment under this Code for any of the offences defined in this Chapter.
Bharatiya Nyaya Sanhita, 2023
Section 167 Persons subject to certain Acts
No person subject to the Air Force Act, 1950 (45 of 1950), the Army Act, 1950 (46 of 1950) and the Navy Act, 1957 (62 of 1957), or shall be subject to punishment under this Sanhita for any of the offences defined in this Chapter.
The texts are India Code’s. The amendment markers and footnotes of the official print are left out, so the old section reads as it stood when it was repealed; State amendments are not shown. The PDFs linked below carry the full history.