File tree Expand file tree Collapse file tree
Functions/VCS_Info/Backends Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 2020-06-22 Manuel Jacob <me@manueljacob.de>
2+
3+ * 46091: Doc/Zsh/contrib.yo,
4+ Functions/VCS_Info/Backends/VCS_INFO_get_data_hg: Add code to
5+ Mercurial VCS backend to show topic if there is any.
6+
172020-06-19 Daniel Shahaf <d.s@daniel.shahaf.name>
28
39 * 46044 (tweaked per Matthew): Completion/Unix/Command/_units:
Original file line number Diff line number Diff line change @@ -1328,7 +1328,8 @@ enditem()
13281328In tt(branchformat) these replacements are done:
13291329
13301330startsitem()
1331- sitem(tt(%b))(The branch name.)
1331+ sitem(tt(%b))(The branch name. For tt(hg), the branch name can include a
1332+ topic name.)
13321333sitem(tt(%r))(The current revision number or the tt(hgrevformat) style for
13331334tt(hg).)
13341335endsitem()
Original file line number Diff line number Diff line change 55
66setopt localoptions extendedglob NO_shwordsplit
77
8- local hgbase bmfile branchfile rebasefile dirstatefile mqseriesfile \
8+ local hgbase bmfile branchfile topicfile rebasefile dirstatefile mqseriesfile \
99 curbmfile curbm \
1010 mqstatusfile mqguardsfile patchdir mergedir \
1111 r_csetid r_lrev r_branch i_bmhash i_bmname \
@@ -27,6 +27,7 @@ mergedir="${hgbase}/.hg/merge/"
2727bmfile=" ${hgbase} /.hg/bookmarks"
2828curbmfile=" ${hgbase} /.hg/bookmarks.current"
2929branchfile=" ${hgbase} /.hg/branch"
30+ topicfile=" ${hgbase} /.hg/topic"
3031rebasefile=" ${hgbase} /.hg/rebasestate"
3132dirstatefile=" ${hgbase} /.hg/dirstate"
3233mqstatusfile=" ${patchdir} /status" # currently applied patches
6970# If we still don't know the branch it's safe to assume default
7071[[ -n ${r_branch} ]] || r_branch=" default"
7172
73+ # Show topic if there is any (the UI for this experimental concept is not yet
74+ # final, but for a long time the convention has been to join the branch name
75+ # and the topic name by a colon)
76+ if [[ -f ${topicfile} && -r ${topicfile} && -s ${topicfile} ]] ; then
77+ IFS= read -r REPLY < ${topicfile}
78+ r_branch=${r_branch} :${REPLY}
79+ fi
80+
7281# The working dir has uncommitted-changes if the revision ends with a +
7382if [[ $r_lrev [-1] == + ]] ; then
7483 hgchanges=1
You can’t perform that action at this time.
0 commit comments