From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15335 invoked from network); 7 Jun 2020 13:50:22 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 7 Jun 2020 13:50:22 -0000 Received: (qmail 18093 invoked by alias); 7 Jun 2020 13:50:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 46018 Received: (qmail 1576 invoked by uid 1010); 7 Jun 2020 13:50:14 -0000 X-Qmail-Scanner-Diagnostics: from indus.uberspace.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25828. spamassassin: 3.4.4. Clear:RC:0(95.143.172.201):SA:0(-1.9/5.0):. Processed in 0.707495 secs); 07 Jun 2020 13:50:14 -0000 X-Envelope-From: me@manueljacob.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at manueljacob.de does not designate permitted sender hosts) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 07 Jun 2020 15:49:39 +0200 From: Manuel Jacob To: zsh-workers@zsh.org Subject: Re: [PATCH] Add code to Mercurial VCS backend to show topic if there is any. In-Reply-To: <20200607074445.7723-1-me@manueljacob.de> References: <20200607074445.7723-1-me@manueljacob.de> Message-ID: <04e0ef2cfe479e914c3c18fa16a79a2c@manueljacob.de> X-Sender: me@manueljacob.de On 2020-06-07 09:44, Manuel Jacob wrote: > "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. > --- > 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 I've sent a v2 of this patch that properly handles a zero .hg/topic file, which means "no topic set" (the same as no .hg/topic file). > + 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