phases, local and remote; topics
Becker, Mischa J
mischa.becker at kroger.com
Mon Dec 21 18:10:36 UTC 2020
> -----Original Message-----
> From: Uwe Brauer
> Sent: Monday, December 21, 2020 8:31 AM
> To: mercurial at mercurial-scm.org
> Subject: phases, local and remote; topics
>
> ** [EXTERNAL EMAIL]: Do not click links or open attachments unless you
> recognize the sender and know the content is safe. **
>
> Hi
>
> I just noted that when pulling from
>
> https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdev.hept
> apod.net%2Fmercurial%2Fhg-
> git&data=04%7C01%7Cmischa.becker%40kroger.com%7C67c46a462dfe411fc4b108
> d8a5cde51e%7C8331e14a91344288bf5a5e2c8412f074%7C0%7C0%7C637441651031279994
> %7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1ha
> WwiLCJXVCI6Mn0%3D%7C1000&sdata=ck9S4bXcusXdvt8tpYJ8NDyAsHzLk%2Bf9sWNz%
> 2FVulZVs%3D&reserved=0
>
> And running
>
> Hg log -G
>
> I see.
>
>
> │ ○ changeset: 1484:c6a262158160
> │╱ Branch: default
> │ Author: Dan Villiom Podlaski Christiansen <danchr at gmail.com>
> │ Date: Wed, 09 Dec 2020 23:24:54 +0100
> │ Topic: ci-tweaks
> │ Phase: draft
> │ Summary: ci: fix XML report path
> │
> ○ changeset: 1483:19d34b8f69da
> │ Branch: default
> │ Author: Dan Villiom Podlaski Christiansen <danchr at gmail.com>
> │ Date: Sat, 12 Dec 2020 13:11:18 +0100
> │ Phase: public
> │ Summary: ssh: fix Python 3 and Windows
>
> That is precisely the behavior I would like to have for the repositories I
> push to Helix, the ones with a topic are (still) in the draft phase, while
> the topic free ones are in the public phase.
>
> Now in my understanding the logic behind phases is this
>
>
> | | | remote | local | pull | push | clone |
> |---+---------------+--------+-------+--------+--------+--------|
> | 1 | phase publish | true | true | public | public | public |
> | 2 | | true | false | draft | public | draft |
> | 3 | | false | false | draft | draft | draft |
> | 4 | | false | true | public | draft | public |
I don't know how phase works with topics but this isn't how it works without topics.
A commit's phase is initially set based on the publish setting of the repo you commit to. An existing draft commit will update to public if pushed into\pulled from a publish=true repo but a public commit doesn't down grade back to draft unless you force it.
>
> I tried to simulate this by
> starting a fresh local repository like this
>
> $ mkdir Server
> $ cd Server
> $ hg init
> $ echo "[phase]\npublish=false" >> .hg/hgrc $ echo "First line" >>
> test.org $ hg addremove $ hg ci -m "First commit not publishing"
>
>
> Then I wanted to consider Server as remote and clone it and consider the
> Clone as local. But something did not work as expected.
>
> In my global .hgrc I have
>
> [phases]
> publish = True
>
> So after cloning
>
> hg clone Server local
>
> cd local
>
> hg log -G
>
> changeset: 0:a40cb56af932
> Branch: default
> tag: tip
> Author: Uwe Brauer <oub at mat.ucm.es>
> Date: Mon, 21 Dec 2020 17:26:16 +0100
> Phase: public
> Summary: First commit not publishing
>
> echo "Change" >> test.org
> hg ci -m "Change local"
If your local repo has publish=true then running hg log -G now would show that the new changeset is public.
> hg push
>
> hg log -G
>
> ◍ changeset: 1:2c383a3d8fa0
> │ Branch: default
> │ tag: tip
> │ Author: Uwe Brauer <oub at mat.ucm.es>
> │ Date: Mon, 21 Dec 2020 17:27:44 +0100
> │ Phase: public
> │ Summary: Change
> │
> ○ changeset: 0:a40cb56af932
> Branch: default
> Author: Uwe Brauer <oub at mat.ucm.es>
> Date: Mon, 21 Dec 2020 17:26:16 +0100
> Phase: public
> Summary: First commit not publishing
>
> But the "Server/remote setting" is
> [phase]
> publish=false
>
> So why is the phase after pushing public?
Because it was public before pushing. Pushing a public changset to a publish=false repo won't down grade it back to draft.
Mischa Becker
________________________________
This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
More information about the Mercurial
mailing list