commit .hgsubstate after remove from .hgsub

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

commit .hgsubstate after remove from .hgsub

Jérôme Godbout
Hi,

First we have a main repos with both .hgsub and .hgsubstate commited into the main repos itself.

We had a sub repos we wanted to be removed so we end up removing the entry from the .hgsub file of the main repos.

But we don't seem to be able to commit the .hgsubstate and this give us some problems and warnings when updating and merging after this.

How does one sanitize (it's just removing the hash line for that gone sub repos) the .hgsubstate for pushing or commit modification?

What is the normal procedure to remove a sub repos?
Thanks,


bodycad
Jerome Godbout
Software Developer
2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
T:  +1 418 527-1388
E: [hidden email]
www.bodycad.com

The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. 

Le contenu de ce message et les pièces jointes sont destinés uniquement pour le(s) destinataire(s) et peuvent contenir des informations confidentielles et / ou privilégiées qui peuvent être protégées légalement contre toute divulgation. Si vous n'êtes pas le destinataire de ce message ou son agent, ou si ce message vous a été adressé par erreur, s’il vous plaît avertir immédiatement l'expéditeur par courriel de réponse, puis supprimer ce message et les pièces jointes. Si vous n'êtes pas le destinataire prévu, vous êtes par la présente informé que toute utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces jointes est strictement interdit.


_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: commit .hgsubstate after remove from .hgsub

Yuya Nishihara
On Thu, 16 Feb 2017 16:07:59 -0500, Jérôme Godbout wrote:
> First we have a main repos with both .hgsub and .hgsubstate commited into
> the main repos itself.
>
> We had a sub repos we wanted to be removed so we end up removing the entry
> from the .hgsub file of the main repos.
>
> But we don't seem to be able to commit the .hgsubstate and this give us
> some problems and warnings when updating and merging after this.

It appears .hgsubstate is updated automatically, so you only need to edit
.hgsub and commit.
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: commit .hgsubstate after remove from .hgsub

Jérôme Godbout
how does one keep the right sub version between checkout/revision then? is that kept into the commit action somewhere into the .hg?

I'm a bit confuse how the info inside the .hgsubstate is transfer from one revision to another. I though that the .hgsubstate was the only place where this info was kept and since you do want a particular revision not necessarily the default sub head.

So if I go back to main rev 12, I want the sub to go back to the same revision when I was using rev 12 too. The way we found to do this is commit the .hgsubstate but if that information is kept somewhere else I would remove it from the commit file list. 

It does feel strange that the .hgsubstate is not simply a regular commited file like .hgsub is. But again, maybe there is an underlayer I don't see at work here.

Thanks,
Jerome

bodycad
Jerome Godbout
Software Developer
2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
T:  +1 418 527-1388
E: [hidden email]
www.bodycad.com

The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. 

Le contenu de ce message et les pièces jointes sont destinés uniquement pour le(s) destinataire(s) et peuvent contenir des informations confidentielles et / ou privilégiées qui peuvent être protégées légalement contre toute divulgation. Si vous n'êtes pas le destinataire de ce message ou son agent, ou si ce message vous a été adressé par erreur, s’il vous plaît avertir immédiatement l'expéditeur par courriel de réponse, puis supprimer ce message et les pièces jointes. Si vous n'êtes pas le destinataire prévu, vous êtes par la présente informé que toute utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces jointes est strictement interdit.


On Fri, Feb 17, 2017 at 8:58 AM, Yuya Nishihara <[hidden email]> wrote:
On Thu, 16 Feb 2017 16:07:59 -0500, Jérôme Godbout wrote:
> First we have a main repos with both .hgsub and .hgsubstate commited into
> the main repos itself.
>
> We had a sub repos we wanted to be removed so we end up removing the entry
> from the .hgsub file of the main repos.
>
> But we don't seem to be able to commit the .hgsubstate and this give us
> some problems and warnings when updating and merging after this.

It appears .hgsubstate is updated automatically, so you only need to edit
.hgsub and commit.


_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: commit .hgsubstate after remove from .hgsub

Roger Pate
In reply to this post by Jérôme Godbout
On Thu, Feb 16, 2017 at 4:07 PM, Jérôme Godbout <[hidden email]> wrote:
> We had a sub repos we wanted to be removed so we end up removing the entry from the .hgsub file of the main repos.

> What is the normal procedure to remove a sub repos?

"To remove a subrepo from the parent repo, you must delete the subrepo
definition from the '.hgsub' file at the top level of the parent repo.
Once you do this, the subrepo tree will show up as a set of unknown
files when you run hg status, and you can delete the files."
https://www.mercurial-scm.org/wiki/Subrepository#Delete

> But we don't seem to be able to commit the .hgsubstate and this give us some problems and warnings when updating and merging after this.

What problems and warnings do you get?
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: commit .hgsubstate after remove from .hgsub

Yuya Nishihara
In reply to this post by Jérôme Godbout
On Fri, 17 Feb 2017 09:23:53 -0500, Jérôme Godbout wrote:
> how does one keep the right sub version between checkout/revision then? is
> that kept into the commit action somewhere into the .hg?

No. subrepo revisions are kept in .hgsubstate.

> I'm a bit confuse how the info inside the .hgsubstate is transfer from one
> revision to another. I though that the .hgsubstate was the only place where
> this info was kept and since you do want a particular revision not
> necessarily the default sub head.
>
> So if I go back to main rev 12, I want the sub to go back to the same
> revision when I was using rev 12 too. The way we found to do this is commit
> the .hgsubstate but if that information is kept somewhere else I would
> remove it from the commit file list.
>
> It does feel strange that the .hgsubstate is not simply a regular commited
> file like .hgsub is. But again, maybe there is an underlayer I don't see at
> work here.

.hgsubstate is a regular file, but its contents are managed by hg, something
like .hgtags. You shouldn't edit it manually, but you just need to commit the
changes made by hg.
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: commit .hgsubstate after remove from .hgsub

Jérôme Godbout
The problem is that hg doesn't let me commit the file telling me that there is no local change event if .hgsubstate have modification where I remove the removed subrepos revision entry. When updating to revision Tortoisehg complain about it that something need to be commit. but I can't commit that file change even by command line.

> On Feb 17, 2017, at 11:37 PM, Yuya Nishihara <[hidden email]> wrote:
>
>> On Fri, 17 Feb 2017 09:23:53 -0500, Jérôme Godbout wrote:
>> how does one keep the right sub version between checkout/revision then? is
>> that kept into the commit action somewhere into the .hg?
>
> No. subrepo revisions are kept in .hgsubstate.
>
>> I'm a bit confuse how the info inside the .hgsubstate is transfer from one
>> revision to another. I though that the .hgsubstate was the only place where
>> this info was kept and since you do want a particular revision not
>> necessarily the default sub head.
>>
>> So if I go back to main rev 12, I want the sub to go back to the same
>> revision when I was using rev 12 too. The way we found to do this is commit
>> the .hgsubstate but if that information is kept somewhere else I would
>> remove it from the commit file list.
>>
>> It does feel strange that the .hgsubstate is not simply a regular commited
>> file like .hgsub is. But again, maybe there is an underlayer I don't see at
>> work here.
>
> .hgsubstate is a regular file, but its contents are managed by hg, something
> like .hgtags. You shouldn't edit it manually, but you just need to commit the
> changes made by hg.
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: commit .hgsubstate after remove from .hgsub

Ludovic Chabant
I'm not sure I totally understand your problem but I know that I had a
lot less problems with subrepos the day I understood that Mercurial
wants a "global commit" to update and manage the .hgsubstate file and
the other subrepo-related stuff. By "global commit" I mean a commit that
does not specify files to commit, or use any exclude patterns. Basically
a straight up "hg commit".

So maybe you have problems because you're trying to run something like
"hg commit .hgsub", or some other filtered-down commit?

> Jérôme Godbout <mailto:[hidden email]>
> February 18, 2017 at 6:42 AM
> The problem is that hg doesn't let me commit the file telling me that
> there is no local change event if .hgsubstate have modification where
> I remove the removed subrepos revision entry. When updating to
> revision Tortoisehg complain about it that something need to be
> commit. but I can't commit that file change even by command line.
>
> _______________________________________________
> Mercurial mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
> Yuya Nishihara <mailto:[hidden email]>
> February 17, 2017 at 8:37 PM
> On Fri, 17 Feb 2017 09:23:53 -0500, Jérôme Godbout wrote:
>> how does one keep the right sub version between checkout/revision then? is
>> that kept into the commit action somewhere into the .hg?
>
> No. subrepo revisions are kept in .hgsubstate.
>
>> I'm a bit confuse how the info inside the .hgsubstate is transfer from one
>> revision to another. I though that the .hgsubstate was the only place where
>> this info was kept and since you do want a particular revision not
>> necessarily the default sub head.
>>
>> So if I go back to main rev 12, I want the sub to go back to the same
>> revision when I was using rev 12 too. The way we found to do this is commit
>> the .hgsubstate but if that information is kept somewhere else I would
>> remove it from the commit file list.
>>
>> It does feel strange that the .hgsubstate is not simply a regular commited
>> file like .hgsub is. But again, maybe there is an underlayer I don't see at
>> work here.
>
> .hgsubstate is a regular file, but its contents are managed by hg, something
> like .hgtags. You shouldn't edit it manually, but you just need to commit the
> changes made by hg.
> _______________________________________________
> Mercurial mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
> Jérôme Godbout <mailto:[hidden email]>
> February 17, 2017 at 6:23 AM
> how does one keep the right sub version between checkout/revision
> then? is that kept into the commit action somewhere into the .hg?
>
> I'm a bit confuse how the info inside the .hgsubstate is transfer from
> one revision to another. I though that the .hgsubstate was the only
> place where this info was kept and since you do want a particular
> revision not necessarily the default sub head.
>
> So if I go back to main rev 12, I want the sub to go back to the same
> revision when I was using rev 12 too. The way we found to do this is
> commit the .hgsubstate but if that information is kept somewhere else
> I would remove it from the commit file list.
>
> It does feel strange that the .hgsubstate is not simply a regular
> commited file like .hgsub is. But again, maybe there is an underlayer
> I don't see at work here.
>
> Thanks,
> Jerome
>
> bodycad <https://www.bodycad.com/>
> Jerome Godbout
> Software Developer
> 2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
> T: +1 418 527-1388
> E: [hidden email] <mailto:[hidden email]>
> www.bodycad.com <http://www.bodycad.com/>
>
> The contents of this email message and any attachments are intended
> solely for the addressee(s) and may contain confidential and/or
> privileged information and may be legally protected from disclosure.
> If you are not the intended recipient of this message or their agent,
> or if this message has been addressed to you in error, please
> immediately alert the sender by reply email and then delete this
> message and any attachments. If you are not the intended recipient,
> you are hereby notified that any use, dissemination, copying, or
> storage of this message or its attachments is strictly prohibited.
>
> Le contenu de ce message et les pièces jointes sont destinés
> uniquement pour le(s) destinataire(s) et peuvent contenir des
> informations confidentielles et / ou privilégiées qui peuvent être
> protégées légalement contre toute divulgation. Si vous n'êtes pas le
> destinataire de ce message ou son agent, ou si ce message vous a été
> adressé par erreur, s’il vous plaît avertir immédiatement l'expéditeur
> par courriel de réponse, puis supprimer ce message et les pièces
> jointes. Si vous n'êtes pas le destinataire prévu, vous êtes par la
> présente informé que toute utilisation, diffusion, copie, ou stockage
> de ce message ou de ses pièces jointes est strictement interdit.
>
>
>
> _______________________________________________
> Mercurial mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
> Yuya Nishihara <mailto:[hidden email]>
> February 17, 2017 at 5:58 AM
>
> It appears .hgsubstate is updated automatically, so you only need to edit
> .hgsub and commit.
> _______________________________________________
> Mercurial mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
> Jérôme Godbout <mailto:[hidden email]>
> February 16, 2017 at 1:07 PM
> Hi,
>
> First we have a main repos with both .hgsub and .hgsubstate commited
> into the main repos itself.
>
> We had a sub repos we wanted to be removed so we end up removing the
> entry from the .hgsub file of the main repos.
>
> But we don't seem to be able to commit the .hgsubstate and this give
> us some problems and warnings when updating and merging after this.
>
> How does one sanitize (it's just removing the hash line for that gone
> sub repos) the .hgsubstate for pushing or commit modification?
>
> What is the normal procedure to remove a sub repos?
> Thanks,
>
>
> bodycad <https://www.bodycad.com/>
> Jerome Godbout
> Software Developer
> 2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
> T: +1 418 527-1388
> E: [hidden email] <mailto:[hidden email]>
> www.bodycad.com <http://www.bodycad.com/>
>
> The contents of this email message and any attachments are intended
> solely for the addressee(s) and may contain confidential and/or
> privileged information and may be legally protected from disclosure.
> If you are not the intended recipient of this message or their agent,
> or if this message has been addressed to you in error, please
> immediately alert the sender by reply email and then delete this
> message and any attachments. If you are not the intended recipient,
> you are hereby notified that any use, dissemination, copying, or
> storage of this message or its attachments is strictly prohibited.
>
> Le contenu de ce message et les pièces jointes sont destinés
> uniquement pour le(s) destinataire(s) et peuvent contenir des
> informations confidentielles et / ou privilégiées qui peuvent être
> protégées légalement contre toute divulgation. Si vous n'êtes pas le
> destinataire de ce message ou son agent, ou si ce message vous a été
> adressé par erreur, s’il vous plaît avertir immédiatement l'expéditeur
> par courriel de réponse, puis supprimer ce message et les pièces
> jointes. Si vous n'êtes pas le destinataire prévu, vous êtes par la
> présente informé que toute utilisation, diffusion, copie, ou stockage
> de ce message ou de ses pièces jointes est strictement interdit.
>
> _______________________________________________
> Mercurial mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial

--
--
l u d o .
. 8 0 17 80
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: commit .hgsubstate after remove from .hgsub

Yuya Nishihara
On Sat, 18 Feb 2017 08:37:34 -0800, Ludovic Chabant wrote:

> I'm not sure I totally understand your problem but I know that I had a
> lot less problems with subrepos the day I understood that Mercurial
> wants a "global commit" to update and manage the .hgsubstate file and
> the other subrepo-related stuff. By "global commit" I mean a commit that
> does not specify files to commit, or use any exclude patterns. Basically
> a straight up "hg commit".
>
> So maybe you have problems because you're trying to run something like
> "hg commit .hgsub", or some other filtered-down commit?
>
> > Jérôme Godbout <mailto:[hidden email]>
> > February 18, 2017 at 6:42 AM
> > The problem is that hg doesn't let me commit the file telling me that
> > there is no local change event if .hgsubstate have modification where
> > I remove the removed subrepos revision entry. When updating to
> > revision Tortoisehg complain about it that something need to be
> > commit. but I can't commit that file change even by command line.

Short answer: Don't use TortoiseHg to remove subrepos, run "hg ci" instead.

Long answer: This appears to be a bug of TortoiseHg and Mercurial. When adding
a subrepo, THg runs:

  % hg ci .hgsub subrepodir

If the subrepodir is excluded, Mercurial would complain about that:

  % hg ci .hgsub
  abort: commit with new subrepo subrepodir excluded

But when removing, THg doesn't include the removed subrepodir:

  % hg ci .hgsub

and it passes without an error. Also, the subrepodir can't be specified
explicitly:

  % hg ci .hgsub subrepodir
  abort: subrepodir: no match under directory!
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: commit .hgsubstate after remove from .hgsub

Jérôme Godbout
Seem like TortoiseHg problem indeed, messing around a bit we could make the problem goes away but commiting (no change seen or revison changed) when merging with TortoiseHg.

Thanks for the tips

bodycad
Jerome Godbout
Software Developer
2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
T:  +1 418 527-1388
E: [hidden email]
www.bodycad.com

The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. 

Le contenu de ce message et les pièces jointes sont destinés uniquement pour le(s) destinataire(s) et peuvent contenir des informations confidentielles et / ou privilégiées qui peuvent être protégées légalement contre toute divulgation. Si vous n'êtes pas le destinataire de ce message ou son agent, ou si ce message vous a été adressé par erreur, s’il vous plaît avertir immédiatement l'expéditeur par courriel de réponse, puis supprimer ce message et les pièces jointes. Si vous n'êtes pas le destinataire prévu, vous êtes par la présente informé que toute utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces jointes est strictement interdit.


On Sat, Feb 18, 2017 at 10:07 PM, Yuya Nishihara <[hidden email]> wrote:
On Sat, 18 Feb 2017 08:37:34 -0800, Ludovic Chabant wrote:
> I'm not sure I totally understand your problem but I know that I had a
> lot less problems with subrepos the day I understood that Mercurial
> wants a "global commit" to update and manage the .hgsubstate file and
> the other subrepo-related stuff. By "global commit" I mean a commit that
> does not specify files to commit, or use any exclude patterns. Basically
> a straight up "hg commit".
>
> So maybe you have problems because you're trying to run something like
> "hg commit .hgsub", or some other filtered-down commit?
>
> > Jérôme Godbout <mailto:[hidden email]>
> > February 18, 2017 at 6:42 AM
> > The problem is that hg doesn't let me commit the file telling me that
> > there is no local change event if .hgsubstate have modification where
> > I remove the removed subrepos revision entry. When updating to
> > revision Tortoisehg complain about it that something need to be
> > commit. but I can't commit that file change even by command line.

Short answer: Don't use TortoiseHg to remove subrepos, run "hg ci" instead.

Long answer: This appears to be a bug of TortoiseHg and Mercurial. When adding
a subrepo, THg runs:

  % hg ci .hgsub subrepodir

If the subrepodir is excluded, Mercurial would complain about that:

  % hg ci .hgsub
  abort: commit with new subrepo subrepodir excluded

But when removing, THg doesn't include the removed subrepodir:

  % hg ci .hgsub

and it passes without an error. Also, the subrepodir can't be specified
explicitly:

  % hg ci .hgsub subrepodir
  abort: subrepodir: no match under directory!


_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial