From: Manuel Jacob <me@manueljacob.de>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] Add code to Mercurial VCS backend to show topic if there is any.
Date: Sun, 07 Jun 2020 15:31:26 +0200 [thread overview]
Message-ID: <b888b9114e56c82ed0aef0a271730159@manueljacob.de> (raw)
In-Reply-To: <20200607121443.7c58ee16@tarpaulin.shahaf.local2>
Hi Daniel,
On 2020-06-07 14:14, Daniel Shahaf wrote:
> Manuel Jacob wrote on Sun, 07 Jun 2020 09:44 +0200:
>> "Topics" is an experimental concept in Mercurial that augments the
>> current branching concept (called "named branches").
>>
>> For more information, see the not always up-to-date Mercurial Wiki
>> page
>> https://www.mercurial-scm.org/wiki/TopicPlan.
>
> I assume "experimental" means "future releases of Mercurial are not
> promised to be backwards compatible with the current design".
It is not yet part of Mercurial itself, but developed separately as an
extension under the Mercurial project roof.
> Is the .hg/topic file name and data format set in stone yet?
>
> What if zsh 5.9 is released and then the Mercurial developers change
> the design to make .hg/topic a directory, and release _that_? Then
> everyone who uses zsh 5.9 with hg will be stuck with vcs_info errors
> until their distro upgrades to newer zsh.
The .hg/topic file works very similar to the .hg/branch file (which is
stable since 2007 and which zsh currently depends on). I can't think of
any reason why someone would consider changing the format.
The file would only be created if a user installs and activates the
extension, and explictly creates a topic (a specific kind of feature
branch), so that makes it even more unlikely that something breaks.
> Cheers,
>
> Daniel
>
>> ---
>> Functions/VCS_Info/Backends/VCS_INFO_get_data_hg | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
>> b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
>> index cd5ef321d..e898f7298 100644
>> --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
>> +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
>> @@ -5,7 +5,7 @@
>>
>> setopt localoptions extendedglob NO_shwordsplit
>>
>> -local hgbase bmfile branchfile rebasefile dirstatefile mqseriesfile \
>> +local hgbase bmfile branchfile topicfile rebasefile dirstatefile
>> mqseriesfile \
>> curbmfile curbm \
>> mqstatusfile mqguardsfile patchdir mergedir \
>> r_csetid r_lrev r_branch i_bmhash i_bmname \
>> @@ -27,6 +27,7 @@ mergedir="${hgbase}/.hg/merge/"
>> bmfile="${hgbase}/.hg/bookmarks"
>> curbmfile="${hgbase}/.hg/bookmarks.current"
>> branchfile="${hgbase}/.hg/branch"
>> +topicfile="${hgbase}/.hg/topic"
>> rebasefile="${hgbase}/.hg/rebasestate"
>> dirstatefile="${hgbase}/.hg/dirstate"
>> mqstatusfile="${patchdir}/status" # currently applied patches
>> @@ -69,6 +70,13 @@ fi
>> # If we still don't know the branch it's safe to assume default
>> [[ -n ${r_branch} ]] || r_branch="default"
>>
>> +# Show topic if there is any (the UI for this experimental concept is
>> not yet
>> +# final, but for a long time the convention has been to join the
>> branch name
>> +# and the topic name by a colon)
>> +if [[ -r ${topicfile} ]] ; then
>> + r_branch=${r_branch}:$(< ${topicfile})
>> +fi
>> +
>> # The working dir has uncommitted-changes if the revision ends with a
>> +
>> if [[ $r_lrev[-1] == + ]] ; then
>> hgchanges=1
next prev parent reply other threads:[~2020-06-07 13:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-07 7:44 Manuel Jacob
2020-06-07 12:14 ` Daniel Shahaf
2020-06-07 13:31 ` Manuel Jacob [this message]
2020-06-08 5:31 ` Daniel Shahaf
2020-06-09 1:15 ` Manuel Jacob
2020-06-09 22:34 ` Daniel Shahaf
2020-06-17 8:27 ` Daniel Shahaf
2020-06-19 2:06 ` Manuel Jacob
2020-06-19 10:07 ` Daniel Shahaf
2020-06-19 10:46 ` vcs_info patch-format/applied-string awareness? (was: Re: [PATCH] Add code to Mercurial VCS backend to show topic if there is any.) Daniel Shahaf
2020-06-19 22:48 ` vcs_info patch-format/applied-string awareness? Manuel Jacob
2020-06-20 9:54 ` Daniel Shahaf
2020-06-20 22:06 ` Manuel Jacob
2020-06-19 23:29 ` [PATCH] Add code to Mercurial VCS backend to show topic if there is any Manuel Jacob
2020-06-20 10:43 ` Daniel Shahaf
2020-06-07 13:49 ` Manuel Jacob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b888b9114e56c82ed0aef0a271730159@manueljacob.de \
--to=me@manueljacob.de \
--cc=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).