Skip to content
  • Matt Harbison's avatar
    exchange: ensure all outgoing subrepo references are present before pushing · 4b7d5d10c45d
    Matt Harbison authored
    We've run into occasional problems with people committing a repo, and then
    amending or rebasing in the subrepo.  That makes it so that the revision in the
    parent can't be checked out, and the problem gets propagated on push.  Mercurial
    already tries to defend against this sort of dangling reference by pushing *all*
    subrepo revisions first.  This reuses the checks that trigger warnings in
    `hg verify` to bail on the push unless using `--force`.
    
    I thought about putting this on the server side, but at that point, all of the
    data has been transferred, only to bail out.  Additionally, SCM Manager hosts
    subrepos in a location that isn't nested in the parent, so normal subrepo code
    would complain that the subrepo is missing when run on the server.
    
    Because the push command pushes subrepos before calling this exchange code, a
    subrepo will be pushed before the parent is verified.  Not great, but no
    dangling references are exchanged, so it ...
    4b7d5d10c45d