Author: rinrab
Date: Thu Apr 16 19:28:19 2026
New Revision: 1933123
Log:
svnbrowse: Display the browsing revision number to the right from URL.
* subversion/svnbrowse/svnbrowse.c
(format_revision_header): New function.
(view_draw_header): Put formatted revision number into suffix; use the lazy
approach by concatinating it with double-spaced string for the indentation.
Modified:
subversion/trunk/subversion/svnbrowse/svnbrowse.c
Modified: subversion/trunk/subversion/svnbrowse/svnbrowse.c
==============================================================================
--- subversion/trunk/subversion/svnbrowse/svnbrowse.c Thu Apr 16 19:05:30 2026 (r1933122)
+++ subversion/trunk/subversion/svnbrowse/svnbrowse.c Thu Apr 16 19:28:19 2026 (r1933123)
@@ -367,6 +367,16 @@ view_draw_item(const svn_browse__item_t
waddch(win, ' ');
}
+static char *
+format_revision_header(svn_revnum_t revnum, svn_revnum_t fetched_revnum,
+ apr_pool_t *pool)
+{
+ if (! SVN_IS_VALID_REVNUM(revnum))
+ return apr_psprintf(pool, "r%ld (HEAD)", fetched_revnum);
+ else
+ return apr_psprintf(pool, "r%ld", fetched_revnum);
+}
+
static void
view_draw_header(svn_browse__view_t *view, WINDOW *win,
apr_pool_t *scratch_pool)
@@ -374,8 +384,12 @@ view_draw_header(svn_browse__view_t *vie
const char *abspath = svn_path_url_add_component2(
view->model->root, view->model->current->relpath, scratch_pool);
svn_stringbuf_t *buf = svn_stringbuf_create_empty(scratch_pool);
+
const char *prefix = " ";
- const char *suffix = " ";
+ const char *suffix = format_revision_header(view->model->revision,
+ view->model->current->revision,
+ scratch_pool);
+ suffix = apr_pstrcat(scratch_pool, suffix, " ", SVN_VA_NULL);
wmove(win, 0, 0);
wattrset(win, COLOR_PAIR(COLOR_PAIR_HEADER));
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.