[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial
Subject:    Re: Problem cloning a project whose subpath remote path has changed
From:       Ludovic Chabant <ludovic () chabant ! com>
Date:       2017-03-13 14:11:44
Message-ID: 78182A8C-5DBA-4449-99BA-9EF1EC1F7964 () chabant ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Ah interesting, I didn't catch that the subrepo was also changing types (you like \
danger :) )

I think I would just delete the subrepo folder and do an update so Mercurial can \
recreate the repo by itself from the right URL. For these kinds of things you \
basically need workarounds since subrepo workflows are still considered \
experimental/last-recourse stuff and don't support all situations.

l u d o .
. 8 0 17 80

> On Mar 13, 2017, at 06:49, Cathryn Griffiths <cathryn@ffctn.com> wrote:
> 
> Hi Ludovic,
> 
> Thanks for the reply and the suggested fix! I tried it out but unfortunately it \
> didn't solve the problem in my case. Since I've changed the subrepo from a git \
> subrepo to an hg subrepo, I can't just update the git remote - I'd need to delete \
> the git subrepo, then add the hg repo, but that doesn't work. For example, \
> immediately after I get the error message, if I go into the subrepo, it has the \
> files and file structure of the git repo. If I delete the subrepo file entirely and \
> try to commit the subrepo folder deletion, I get an abort message: 
> abort: last update was interrupted
> (use 'hg update' to get a consistent checkout)
> 
> Oddly enough, if I do hg update, it correctly pulls down the correct hg subrepo and \
> does a checkout to the correct revision.  
> Any other tips? 
> Thanks for your help!
> 
> Cathryn
> 
> 
> > On Sun, Mar 12, 2017 at 7:18 PM Ludovic Chabant <ludovic@chabant.com> wrote:
> > Hey,
> > 
> > I've run into that problem a couple times -- especially when you branch a \
> > sub-repo to write a patch, and therefore update your `.hgsub`, but then pull the \
> > changes from another clone of the parent repo. 
> > I can't remember exactly what I do in this situation but I believe it goes like \
> > this: 
> > 1) Pull the changes and update. Get the error message.
> > 2) Go into the sub-repo and update the origin URL. If it's a Mercurial sub-repo, \
> > edit the `hgrc` with the new path, and if it's a Git sub-repo, rename the origin \
> > remote. 3) Run `hg update` again.
> > 
> > Good luck! :)
> > > Cathryn Griffiths March 8, 2017 6:37 AM via Postbox
> > 
> > > Hi all, 
> > > 
> > > I'm having trouble cloning one of my mercurial project repos that has a subrepo \
> > > whose remote path has changed during the course of the project. I was hoping \
> > > the community could provide some guidance on either how to fix this and/or why \
> > > this is happening.  
> > > Here's the situation: 
> > > 
> > > My project has a subrepo whose remote path has changed (Original path [Version \
> > > 1]: git@bitbucket.org:<subrepoversion1>; New path [Version 2]: \
> > > ssh://hg@bitbucket.org/<subrepoversion2>). I changed the path in the .hgsub \
> > > file from that of Version 1 to that of Version 2. The .hgsubstate file was also \
> > > updated to include the latest commit from Version 2.  
> > > When I clone my project, the subrepo that gets cloned is that of Version 1, not \
> > > Version 2. The cloning process then tries to checkout the commit that's \
> > > provided in the .hgsubstate file. Since that commit belongs to subrepo Version \
> > > 2, the clone aborts and shows an error message that "revision \
> > > f3c8dab575b2d97eade69b06da1fcc2a06ba40eb does not exist in subrepo \
> > > deps/ff-libs". Here's the output from the clone:  
> > > requesting all changes 
> > > adding changesets 
> > > adding manifests 
> > > adding file changes 
> > > added 10 changesets with 114 changes to 95 files 
> > > cloning subrepo deps/ff-libs from git@bitbucket.org:<subrepoversion1> 
> > > Cloning into '<myprojectpath>/deps/ff-libs'... 
> > > remote: Counting objects: 3923, done. 
> > > remote: Compressing objects: 100% (1703/1703), done. 
> > > remote: Total 3923 (delta 2850), reused 3061 (delta 2202) 
> > > Receiving objects: 100% (3923/3923), 1.28 MiB | 0 bytes/s, done. 
> > > Resolving deltas: 100% (2850/2850), done. 
> > > Checking connectivity... done. 
> > > checking out detached HEAD in subrepo deps/ff-libs 
> > > check out a git branch if you intend to make changes 
> > > 79 files updated, 0 files merged, 0 files removed, 0 files unresolved 
> > > updating to branch default 
> > > pulling subrepo deps/ff-libs from git@bitbucket.org:<subrepoversion1> 
> > > abort: revision f3c8dab575b2d97eade69b06da1fcc2a06ba40eb does not exist in \
> > > subrepo deps/ff-libs  (in subrepo deps/ff-libs) 
> > > 
> > > 
> > > Here's the .hgsub file contents: 
> > > 
> > > deps/ff-libs = ssh://hg@bitbucket.org/<subrepoversion2> 
> > > 
> > > 
> > > ... and the .hgsubstate file contents: 
> > > 
> > > f3c8dab575b2d97eade69b06da1fcc2a06ba40eb deps/ff-libs 
> > > 
> > > 
> > > Why is the cloning process pulling subrepo Version 1 and not subrepo Version 2? \
> > >  
> > > In case it's relevant, I'm using Mercurial version 3.7.3 on Ubuntu 16.04. 
> > > 
> > > Thanks! 
> > > 
> > > Cathryn 
> > 
> > > _______________________________________________
> > > Mercurial mailing list
> > > Mercurial@mercurial-scm.org
> > > https://www.mercurial-scm.org/mailman/listinfo/mercurial
> > 
> > 
> > -- 
> > Sent from Postbox


[Attachment #5 (text/html)]

<html><head><meta http-equiv="content-type" content="text/html; \
charset=utf-8"></head><body dir="auto"><div>Ah interesting, I didn't catch that the \
subrepo was also changing types (you like danger :) )</div><div \
id="AppleMailSignature"><br></div><div id="AppleMailSignature">I think I would just \
delete the subrepo folder and do an update so Mercurial can recreate the repo by \
itself from the right URL.</div><div id="AppleMailSignature">For these kinds of \
things you basically need workarounds since subrepo workflows are still considered \
experimental/last-recourse stuff and don't support all situations.</div><div \
id="AppleMailSignature"><br>l u d o .<div>. 8 0 17 80</div></div><div><br>On Mar 13, \
2017, at 06:49, Cathryn Griffiths &lt;<a \
href="mailto:cathryn@ffctn.com">cathryn@ffctn.com</a>&gt; \
wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Hi \
Ludovic,<div><br></div><div>Thanks for the reply and the suggested fix! I tried it \
out but unfortunately it didn't solve the problem in my case. Since I've changed the \
subrepo from a git subrepo to an hg subrepo, I can't just update the git remote - I'd \
need to delete the git subrepo, then add the hg repo, but that doesn't work. For \
example, immediately after I get the error message, if I go into the subrepo, it has \
the files and file structure of the git repo. If I delete the subrepo file entirely \
and try to commit the subrepo folder deletion, I get an abort \
message:</div><div><br></div><div><div>abort: last update was \
interrupted</div><div>(use 'hg update' to get a consistent \
checkout)</div></div><div><br></div><div>Oddly enough, if I do hg update, it \
correctly pulls down the correct hg subrepo and does a checkout to the correct \
revision.&nbsp;</div><div><br></div><div>Any other tips?&nbsp;</div><div>Thanks for \
your help!</div><div><br></div><div>Cathryn</div><div><br></div></div><br><div \
class="gmail_quote"><div dir="ltr">On Sun, Mar 12, 2017 at 7:18 PM Ludovic Chabant \
&lt;<a href="mailto:ludovic@chabant.com">ludovic@chabant.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">

<div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">Hey,<br class="gmail_msg">
<br class="gmail_msg">
I've run into that problem a couple times -- especially when you branch a
 sub-repo to write a patch, and therefore update your `.hgsub`, but then
 pull the changes from another clone of the parent repo.<br class="gmail_msg">
<br class="gmail_msg">
I can't remember exactly what I do in this situation but I believe it 
goes like this:<br class="gmail_msg">
<span class="gmail_msg">

</span><br class="gmail_msg">
1) Pull the changes and update. Get the error message.<br class="gmail_msg">
2) Go into the sub-repo and update the origin URL. If it's a Mercurial 
sub-repo, edit the `hgrc` with the new path, and if it's a Git sub-repo,
 rename the origin remote.<br class="gmail_msg">
3) Run `hg update` again.<br class="gmail_msg">
<br class="gmail_msg">
Good luck! :)<br class="gmail_msg">
<blockquote style="border:0px none" type="cite" class="gmail_msg">
  <div style="margin:30px 25px 10px 25px" class="m_5877051879385589832__pbConvHr \
gmail_msg"><div style="width:100%;border-top:2px solid #edf1f4;padding-top:10px" \
class="gmail_msg">   <div \
style="display:inline-block;white-space:nowrap;vertical-align:middle;width:49%" \
class="gmail_msg">  <a href="mailto:cathryn@ffctn.com" \
style="color:#485664!important;padding-right:6px;font-weight:500;text-decoration:none!important" \
class="gmail_msg" target="_blank">Cathryn Griffiths</a></div>   <div \
style="display:inline-block;white-space:nowrap;vertical-align:middle;width:48%;text-align:right" \
class="gmail_msg">     <font color="#909AA4" class="gmail_msg"><span \
style="padding-left:6px" class="gmail_msg">March  8, 2017 6:37 AM</span><a \
href="https://www.postbox-inc.com/?utm_source=email&amp;utm_medium=sumlink&amp;utm_campaign=reach" \
style="color:#9fa2a5!important;text-decoration:none!important" class="gmail_msg" \
target="_blank"> via  Postbox</a></font></div>    </div></div>
  <div style="color:#909aa4;margin-left:24px;margin-right:24px" \
class="m_5877051879385589832__pbConvBody gmail_msg"></div></blockquote></div><div \
bgcolor="#FFFFFF" text="#000000" class="gmail_msg"><blockquote style="border:0px \
none" type="cite" class="gmail_msg"><div \
style="color:#909aa4;margin-left:24px;margin-right:24px" \
class="m_5877051879385589832__pbConvBody gmail_msg"><div dir="ltr" \
class="gmail_msg">Hi all, <br class="gmail_msg">
<br class="gmail_msg">I'm having trouble cloning one of my mercurial project repos \
that  has a 
subrepo whose remote path has changed during the course of the project. 
I was hoping the community could provide some guidance on either how to 
fix this and/or why this is happening.
<br class="gmail_msg">
<br class="gmail_msg">Here's the situation:
<br class="gmail_msg">
<br class="gmail_msg">My project has a subrepo whose remote path has changed \
(Original  path 
[Version 1]: <a href="mailto:git@bitbucket.org" \
class="m_5877051879385589832inbox-inbox-moz-txt-link-abbreviated gmail_msg" \
target="_blank">git@bitbucket.org</a>:&lt;subrepoversion1&gt;;  New path [Version 2]: \
 <a href="mailto:ssh://hg@bitbucket.org/" \
class="m_5877051879385589832inbox-inbox-moz-txt-link-abbreviated gmail_msg" \
target="_blank">ssh://hg@bitbucket.org/</a>&lt;subrepoversion2&gt;).  I changed the \
                path in the 
.hgsub file from that of Version 1 to that of Version 2. The .hgsubstate
 
file was also updated to include the latest commit from Version 2.
<br class="gmail_msg">
<br class="gmail_msg">When I clone my project, the subrepo that gets cloned is that \
of  Version 
1, not Version 2. The cloning process then tries to checkout the commit 
that's provided in the .hgsubstate file. Since that commit belongs to 
subrepo Version 2, the clone aborts and shows an error message that 
"revision f3c8dab575b2d97eade69b06da1fcc2a06ba40eb does not exist in 
subrepo deps/ff-libs". Here's the output from the clone:
<br class="gmail_msg">
<br class="gmail_msg">requesting all changes
<br class="gmail_msg">adding changesets
<br class="gmail_msg">adding manifests
<br class="gmail_msg">adding file changes
<br class="gmail_msg">added 10 changesets with 114 changes to 95 files
<br class="gmail_msg">cloning subrepo deps/ff-libs from <a \
href="mailto:git@bitbucket.org" \
class="m_5877051879385589832inbox-inbox-moz-txt-link-abbreviated gmail_msg" \
target="_blank">git@bitbucket.org</a>:&lt;subrepoversion1&gt; <br \
class="gmail_msg">Cloning into '&lt;myprojectpath&gt;/deps/ff-libs'... <br \
class="gmail_msg">remote: Counting objects: 3923, done. <br class="gmail_msg">remote: \
Compressing objects: 100% (1703/1703), done. <br class="gmail_msg">remote: Total 3923 \
(delta 2850), reused 3061 (delta 2202) <br class="gmail_msg">Receiving objects: 100% \
(3923/3923), 1.28 MiB | 0 bytes/s, done. <br class="gmail_msg">Resolving deltas: 100% \
(2850/2850), done. <br class="gmail_msg">Checking connectivity... done.
<br class="gmail_msg">checking out detached HEAD in subrepo deps/ff-libs
<br class="gmail_msg">check out a git branch if you intend to make changes
<br class="gmail_msg">79 files updated, 0 files merged, 0 files removed, 0 files 
unresolved
<br class="gmail_msg">updating to branch default
<br class="gmail_msg">pulling subrepo deps/ff-libs from <a \
href="mailto:git@bitbucket.org" \
class="m_5877051879385589832inbox-inbox-moz-txt-link-abbreviated gmail_msg" \
target="_blank">git@bitbucket.org</a>:&lt;subrepoversion1&gt; <br \
class="gmail_msg">abort: revision f3c8dab575b2d97eade69b06da1fcc2a06ba40eb does not  \
exist  in subrepo deps/ff-libs
<br class="gmail_msg">&nbsp;(in subrepo deps/ff-libs)
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">Here's the .hgsub file contents:
<br class="gmail_msg">
<br class="gmail_msg">deps/ff-libs = <a href="mailto:ssh://hg@bitbucket.org/" \
class="m_5877051879385589832inbox-inbox-moz-txt-link-abbreviated gmail_msg" \
target="_blank">ssh://hg@bitbucket.org/</a>&lt;subrepoversion2&gt; <br \
class="gmail_msg"> <br class="gmail_msg">
<br class="gmail_msg">... and the .hgsubstate file contents:
<br class="gmail_msg">
<br class="gmail_msg">f3c8dab575b2d97eade69b06da1fcc2a06ba40eb deps/ff-libs
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">Why is the cloning process pulling subrepo Version 1 and not \
subrepo  
Version 2?
<br class="gmail_msg">
<br class="gmail_msg">In case it's relevant, I'm using Mercurial version 3.7.3 on \
Ubuntu  16.04.
<br class="gmail_msg">
<br class="gmail_msg">Thanks!
<br class="gmail_msg">
<br class="gmail_msg">Cathryn&nbsp;<br class="gmail_msg"></div>

</div></blockquote></div><div bgcolor="#FFFFFF" text="#000000" \
class="gmail_msg"><blockquote style="border:0px none" type="cite" \
class="gmail_msg"><div style="color:#909aa4;margin-left:24px;margin-right:24px" \
class="m_5877051879385589832__pbConvBody gmail_msg"><div \
class="gmail_msg">_______________________________________________<br \
class="gmail_msg">Mercurial  mailing list<br class="gmail_msg"><a \
class="m_5877051879385589832moz-txt-link-abbreviated gmail_msg" \
href="mailto:Mercurial@mercurial-scm.org" \
target="_blank">Mercurial@mercurial-scm.org</a><br class="gmail_msg"><a \
class="m_5877051879385589832moz-txt-link-freetext gmail_msg" \
href="https://www.mercurial-scm.org/mailman/listinfo/mercurial" \
target="_blank">https://www.mercurial-scm.org/mailman/listinfo/mercurial</a><br \
class="gmail_msg"></div></div> </blockquote></div><div bgcolor="#FFFFFF" \
text="#000000" class="gmail_msg"> <br class="gmail_msg">
<div class="m_5877051879385589832moz-signature gmail_msg">-- <br class="gmail_msg">
<div class="gmail_msg">Sent from <a \
href="https://www.postbox-inc.com/?utm_source=email&amp;utm_medium=siglink&amp;utm_campaign=reach" \
class="gmail_msg" target="_blank"><span style="color:rgb(0,157,247)" \
class="gmail_msg">Postbox</span></a></div></div> </div></blockquote></div>
</div></blockquote></body></html>


[Attachment #6 (text/plain)]

_______________________________________________
Mercurial mailing list
Mercurial@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic