If a file lies in a directory backed by a Subversion repo ending with either trunk or branches/X how do I make the trunk or X show up in the mode-line as SVN-trunk or SVN-X similar to what is shown in Git-backed files typically as Git-master.
Subversion Branch in Mode-Line
239 Views Asked by Nordlöw At
2
There are 2 best solutions below
2
Stefan
On
You could define a function:
(defun vc-svn-mode-line-string (file)
(format "SVN-%s" (vc-svn-current-branch-name file)))
Of course, you'd also have to define vc-svn-current-branch-name because that one doesn't exist yet. I guess it would have to do something like
(defun vc-svn-current-branch-name (file)
(with-temp-buffer
(setq default-directory (file-name-directory file))
(vc-svn-command t t file "info")
...extract the branch name from the info in current buffer..
))
Related Questions in GIT
- problem to push files on a repository git
- diff3 output in git conflict style, including mergeable hunks
- Git Not In Sync with Local Branch
- Setting up the version control of .dotfiles while the .config is connected to a forked repo
- How to fix overriding the main branch in Git?
- I can't add text to "Message" in VS Code when committing to Git
- How can i redirect pull request from main branch to another branch
- Xcode commits (possibly outside of any branch) disappeared, how to get them back?
- Git/TortoiseGit : how to apply ONLY the changes from ONE commit from branch A, to branch B?
- How can I reintroduce username an password on git using fedora?
- GIT SKIP EMPTY DIRECTORIES
- Git smudge run once per checkout or per commit?
- I can't find ~/.profile or ~/.bashrc in C:/Users/<user>/.ssh folder
- Set environment variable during push for GitHub Actions
- Android WebRTC compile
Related Questions in SVN
- Cannot load modules/mod_dav_svn.so into server
- Created Jenkins pipeline and added the script in the Pipeline Description.To check out the Project from the svn repository.NotWorking. Any Suggestion
- How to host SVN server on Cloud
- In two subversion repositories (same machine), can I have different usernames with no password prompting?
- Unrelated git histories when moving code from SVN to Git
- Convert local SVN to GIT using Tortoise GIT fails with unable connect?
- Jenkins Pipeline Script Check-in SVN using NPM
- Making latest subversion exec point to my restored subversion data directory
- Can anyone help on this "svn merge" problem?
- clone repo from SVN to GIT: unable to connect to a repository
- Possible to recursively serve an existing SVN checkout folder to another computer?
- How to push certain branches into git repository?
- Subversion svn merge failure
- Jenkins: SVN Checkout missing commit message
- SVN same setup, same user, fine from one machine but from another DAV/PROPFIND error
Related Questions in EMACS
- How can I make 'emacsclient' open in native fullscreen every time I launch it from the terminal in macOS?
- emacsclient does not connect inside ubuntu container
- Emacs use .emacs by default instead .emacs.d/init.el
- Setting up Macaulay 2 on emacs
- org-mime add caption to exported images
- Use the same export attribute for all src-blocks
- Tags Development Tools
- Emacs 29.2 unable to find theme file
- How to automatically allow the execution of code action from HLS in emacs?
- Org-babel remote inline images with TRAMP not exporting in org export
- find and replace regex like that can deal with nested brackets
- Inheriting from variadic types messes up template member function indentation in Emacs
- Invoking org-store-link interactively, errors on calling org-man-store-link
- Disable session save in doom emacs
- How do you connect to a remote emacs server using Microsoft dev tunnels
Related Questions in VERSION-CONTROL
- Setting up the version control of .dotfiles while the .config is connected to a forked repo
- How can i redirect pull request from main branch to another branch
- Visual Studio 2022 convert spaces to tabs on checkout and back to spaces on checkin
- Handle workspace/monorepo with different deployments
- P4 change ownership through command line
- gitignore for Unity VR project does not work
- Different SDK for specific build
- Sourcetree GUI : Why main branch is behind another branch? Is it normal?
- Strongly Connected Components Using Kosaraju Algorithm
- How to use git-credential-gopass with git send-email?
- Run Robot in Jenkinsfile does not fetch the correct test.robot file from Github
- Git Hub not showing my Organization's Repositories in Android Studio
- Sourcetree caches old branches that no longer exist on github. I do not want this
- How to retrieve Inference image location for my Sagemaker pytorch custom model for Model registry
- I have an error with my Material UI react-swipeable-views in TypeScript
Related Questions in MODELINE
- How to colorize some text in the mode-line differently
- Emacs insert true tabs by default
- Is it possible to have a complicated Emacs command as modeline?
- how to load a .vim file on a mode line
- How can I hide all major / minor modes from the mode line without a package?
- How do I turn on vim syntax highlighting via modeline?
- Vim: disable autocmd BufRead (modeline)
- How to Call a Function in Emacs Mode Line Format
- Emacs Mode Line Click Change Buffer
- Vim or Emacs-like modeline magic support for VSCode
- Activate VIM folding markers via modeline
- Mode line will not redraw properly
- Vim bash syntax highlighting with modeline
- emacs: Which plugin is this?
- Emacs: add list of all opened files to mode-line?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Determining SVN status
I am not aware of any built-in way to do this, but you can write your own code for this purpose.
Based on
vc-svn-repository-nameandvc-backendyou can write a function that returns a custom mode text for SVN, and falls back to the default for all other VC systems:If the current file is under SVN, we check its repo URL according to your convention and compile a corresponding mode text. Don't be confused by the name of
vc-svn-repository-hostname, the function actually returns the complete repo URL of the given file.For all other backends, or if the URL does not match any pattern, we fall back to the default VC status text as in
vc-mode.Adding to the mode line
You can then use this function in the mode line, by adding a corresponding mode line construct to
mode-line-format:Since
mode-line-formatis buffer-local, we usesetq-defaultto change its global value. Our new mode line construct checks whethervc-modeis active, that is, whether the file is under version control, and evaluates our function in this case, to obtain our custom status text. See Mode Line Data for more information about mode line constructs.The ellipsis stand for the other content of the mode line, which you may also customize to your liking. I'd suggest, though, that you simply copy the default value of
mode-line-format, and replace(vc-mode vc-mode)with our new construct. That will simply replace the old VC information with our custom status text, and leaves everything else as before.