It allows the freedom of movement between the two countries and will continue even if brexit happens.That's an agreement not to go to war with each other and provide help in times of need. What's that got to do with free movement?
"The terms of the treaty included provisions for guaranteeing the mutual security of both nations and strengthening of commercial ties such as the right of both countries to trade on the terms enjoyed by the subjects of that country. There were even clauses encouraging freedom of movement and settlement between the two countries, as subjects of either country had the right to dwell in the domains of the other."
https://history.blog.gov.uk/2016/05...lo-portuguese-treaty-of-windsor-9th-may-1386/
England and Portugal have never been to war and share the longest alliance in the world; 630 years.