importing a patch concerning a subrepo does not work as expected

Matt Harbison mharbison72 at gmail.com
Sun Jan 21 19:43:13 UTC 2018


On Wed, 10 Jan 2018 11:01:15 -0500, Neuigkeiten <news at akazen.de> wrote:

> Hi folks,
>
> I've TortoiseHG v4.4.2 installed on a Win7 (x64). I've a repository with
> some subrepositories in it. When I try to import a patch for just
> referencing another revision in a suprepository (just resulting in a
> change in the file .hgsubstate) does the change to .hgsubstate file but
> does not the import to the hg-database nevertheless I've selected import
> to "project archive"

Import doesn't update the subrepo before committing, and commit (which  
import uses internally) ignores the .hgsubstate file.  (Instead, it  
queries the subrepo for its current state.)

What you could do as a workaround (if the patch is more than just  
.hgsubstate) is to import the patch, but select "Working Directory"  
instead of "Repository".  Then update the subrepo to the state you want  
it, and then commit, with the message from the patch.

> The patchfile does look something like
>
> -------------------------------------------------------------------------------------
>
> # HG changeset patch
> # User Me
> # Date 1507731745 -7200
> #      Wed Oct 11 16:22:25 2017 +0200
> # Node ID 2605507be89ef4818de204612abc0a65a19d2ba4
> # Parent  9cda247d79c8008d936ced5ffec1e73e97c0272b
> GUI: bump of subrepository
>
> diff -r 9cda247d79c8 -r 2605507be89e .hgsubstate
> --- a/.hgsubstate    Wed Oct 11 07:01:53 2017 +0200
> +++ b/.hgsubstate    Wed Oct 11 16:22:25 2017 +0200
> @@ -1,1 +1,1 @@
> -0000000000000000000000000000000000000000 GUI
> +8fd2c3ac58ac8a09c3c6ecc50ae665afb4228452 GUI
>
> -------------------------------------------------------------------------------------
>
> The import is done so far, that the .hgsubstate file is accordingly
> changed. But the archive is not updated. If I try to commit the change
> in .hgsubstate, tortoisehg tells me, that ther are no changes.
>



More information about the Mercurial mailing list