Best way to push new subrepositories replacing a normal directory?
Benjamin Fritz
fritzophrenic at gmail.com
Thu Dec 4 18:40:49 UTC 2014
On Thu, Dec 4, 2014 at 12:17 PM, Benjamin Fritz <fritzophrenic at gmail.com>
wrote:
>
> I decided to convert my Vim configuration in Mercurial to use
subrepositories for many of my plugins, rather than copying the files in
manually and tracking them as part of my "main" repository.
>
> So, I cloned my current config to a temporary location. I did "hg remove"
to get rid of the existing sets of files for each plugin. Then I did "hg
clone" or "git clone" (depending on the plugin) to get new clones of each
of those repositories. Then I created a .hgsub file to set them all up as
subrepositories, following the recommended practice of using only "simple"
source paths, added it, and committed the whole lot:
>
> [snip]
>
> I figured I'd be able to push if I set up absolute rather than simple
source paths for all my subrepositories, so I did so:
>
> [snip]
>
> This allowed me to push without error. But my very next commit changes
the file back!
>
> [snip]
>
> I tried manually deleting the old directories before...doing a clean
update, then pushing the final changeset and updating to restore the simple
repository paths.
>
>
Oddly enough, a "hg pull --update" seems to work fine even though "hg pull"
followed by "hg update" required me to delete the replaced directories
manually before the update would succeed.
I should mention, I did find and read this thread:
http://mercurial.808500.n3.nabble.com/Cannot-push-repository-change-after-adding-a-subrepo-using-the-simple-quot-subrepo-path-subrepo-pathx-td2807565.html
So I understand a push cannot create a new repository. Does that mean the
above method is the only way to do this?
Furthermore, does it mean I won't ever be able to have a headless
repository with these subrepositories unless I keep the source paths
absolute? Will that even work?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20141204/b29e9b72/attachment-0002.html>
More information about the Mercurial
mailing list