Giter Club home page Giter Club logo

vscode-hg's Introduction

Overview

Integrated Mercurial source control

Prerequisites

Note: This extension leverages your machine's Mercurial (hg) installation,
so you need to install Mercurial first.


Hg

Features

  • Add files and commit from the source control side-bar (i.e. where git normally appears).

  • All the basics: commit, add, forget, update, push and pull.

  • See changes inline within text editor.

  • Interactive log for basic file history and diff.

  • Branch, merge heads, merge with branch, resolve + unresolve files.

  • Quickly switch branches, push and pull via status bar.

  • Supports named-branches or bookmark workflows.

  • Automatic incoming/outgoing counters.

  • Undo/rollback.

  • Shelve/Unshelve support.

  • Purge support.

  • Rebase support.

  • Show annotation for current line or for whole file.

Feedback & Contributing

  • Please report any bugs, suggestions or documentation requests via the Github issues (yes, I see the irony).
  • Feel free to submit pull requests.

Initialize a new repo

Init a repo

  • Just click the Mercurial icon from the source control title area:

Update to a branch/tag/bookmark

Change branches

  • The current branch name is shown in the bottom-left corner.
  • Click it to see a list of branches and tags that you can update to.
  • When hg.useBookmarks is enabled, this changes to bookmarks.

Settings

hg.enabled { boolean }

  • Enables Hg as a source control manager in VS Code.

hg.useBookmarks { boolean }

hg.pushPullScope { all | current | default }

  • Specifies what to include in Push/Pull operations.
  • Depends on the choice of hg.useBookmarks.
  • For named-branches mode:   (i.e. hg.useBookmarks = false)
    "all" — all branches / unrestricted (this is the default)
    "current" — only includes changesets for the current branch
    "default" — only includes changesets for the default branch
  • For bookmarks mode:   (i.e. hg.useBookmarks = true)
    "all" — all bookmarks / unrestricted (this is the default)
    "current" — only includes changesets for the active bookmark
    "default" — only includes changesets for bookmarks on the default branch

hg.pushPullBranch DEPRECATED { all | current | default }

  • Use hg.pushPullScope instead.
  • Specifies which branch(es) should be included in Push/Pull operations.
  • Included only for backwards compatibility.

hg.autoUpdate { boolean }

  • Enables automatic update of working directory to branch/bookmark head after pulling (equivalent to hg pull --update)
    "true" — enabled
    "false" — disabled, manual update/merge required

hg.autoInOut { boolean }

  • Enables automatic counting of incoming/outgoing changes.
  • When enabled, these show in the status bar.
  • Updated every 3 minutes, or whenever a commit/push/pull is done.
  • Note: when hg.pushPullBranch is set to "current" or "default" then only the respective branch will be included in the counts.

hg.autoRefresh { boolean }

  • Enables automatic refreshing of Source Control tab and badge counter when files within the project change:
    "true" — enabled
    "false" — disabled, manual refresh still available.

hg.countBadge { tracked | all | off }

  • Controls the badge counter for Source Control in the activity bar:
    "tracked" — only count changes to tracked files (default).
    "all" — include untracked files in count.
    "off" — no badge counter.

hg.allowPushNewBranches { boolean }

  • Overrides the warning that normally occurs when a new branch is pushed:
    "true" — new branches are pushed without warning (default).
    "false" — shows a prompt when new branches are being pushed (e.g hg push --new-branch)

hg.path { string | null }

  • Specifies an explicit hg file path to use.
  • This should only be used if hg cannot be found automatically.
  • The default behaviour is to search for hg in commonly-known install locations and on the PATH.

hg.commandMode

  • Controls the method used to communicate with hg.
  • There is a slight start-up performance cost with repeatedly running hg commands.
  • Running a command server process in the background allows frequently-used commands to run ~10× faster (e.g. cat, status, summary, branch etc.)
  • The server feature is still expiremental, and is therefore not the default. "cli" — spawn a new hg process per command (default). "server" — run a command server process  i.e. hg serve --cmdserve

hg.lineAnnotationEnabled

  • Enables hg annotate decorations at end of the currently selected lines.

Acknowledgements

Core Maintainers

Other Contributions

ajansveld, hoffmael, nioh-wiki, joaomoreno, nsgundy, KristjanTammekivi, Marcelotsvaz, gd4Ark

vscode-hg's People

Contributors

alexr00 avatar dependabot[bot] avatar epben avatar gd4ark avatar hdpoliveira avatar incidentist avatar joaomoreno avatar marcelotsvaz avatar mrcrowl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vscode-hg's Issues

please allow to pass parameters to hg (to modify how it shows files)

I would like to pass a command such as this to hg:
hg status 'set:unknown() and not binary()'
I can do this in the terminal, but wonder if I can pass parameters to the built in version control gui.
Can you please add a configuration option so I can append extra parameters to the invoked command?
Thanks!

Support per-user .hgrc

Looks like the extension only supports .hg/hgrc for config. I have a single .hgrc in my home path containing my settings, but if I try to commit it yields a "no username" error.

Trouble resolving merge conflicts with Mercurial and vscode

I have done a simple hg merge branch into my current branch.

2 files are in merge conflicts. They are shown correctly separate from the other files that were auto-merged.
However when trying to open the conflict files to see the comparison about what changed I get the following error:

Unable to open 'gulpfile.js (local <-> other)': Unexpected token p in JSON at position 0.

Also when trying to resolve the file, I get this error:

'echomsg' is not recognized as an internal or external command, operable program or batch file.

in the hg output log.

Don't really know what other information I could provide?

Option to use bookmarks instead of branches

Some of us use bookmarks instead of named branches in hg. Would it be possible to add a user option that uses a different command set for this type of setup?

It would require changing just a few commands (mainly 'hg branch' and 'hg branches' to 'hg bookmarks') with some additional string parsing of the output.

Would be happy to help/test with this.

Support commit --amend

It would be rad to be able to amend existing commits rather than always making new ones :)

How to install for Visual Studio Community 2017

Hi,

if I try to install the addin it show following error message from install process:

15.05.2018 10:35:40 - Installiertes Produkt gefunden - Visual Studio Community 2017
15.05.2018 10:35:40 - VSIXInstaller.NoApplicableSKUsException: Diese Erweiterung kann auf den derzeit installierten Produkten nicht installiert werden.
bei VSIXInstaller.App.GetInstallableData(String vsixPath, Boolean isRepairSupported, IEnumerable1& skuData) bei VSIXInstaller.App.Initialize(Boolean isRepairSupported) bei VSIXInstaller.App.Initialize() bei System.Threading.Tasks.Task1.InnerInvoke()
bei System.Threading.Tasks.Task.Execute()

Auto update after pull

Could you add an option (e.g. hg.autoUpdate) to automatically update to the current branch/bookmark after a pull?

(You can probably tell I am really excited about this extension but if you'd like me to slow down submitting issues/feature requests just let me know!)

Thanks!

Extensions creates runaway Python process

Using both VSCode 1.16 and 1.17, I have had issues with an errant subprocess of VSCode sucking up all RAM/DISK on my machine causing the OS to panic. After disabling extension after extension it appears that the culprit is this Hg extension.

The first issue is that the process, as it runs, is eating up every resource it is able to get a hold of. The second issue is that, when VS Code is quit this child process is not being destroyed/torn down. So, even when I try to be proactive an make sure that VSCode doesn't kill me.... it still does because of this still running Python process.

Pulling does not visually complete on front end.

Pulling from a large repo with over SSH, the bottom bar shows the spinning arrows working with a Pulling changes tooltip. Although the pull seems to finish (as confirmed in TortiseHg) the spinning icon never seems to finish,

exclude pieces of code from commit

Is there any way of do that as in "unified diff output" of TortoiseHg? I've been looking around the options but can't find it.

I use it a lot.

Thanks.

[Request] Hide untracked files

Hello,

First, thanks for this module !
My project has thousands of untracked files, which slows down the status query.
I use to perform a "hg status -q" or "hg status -mar" it would be nice if I could set this from the config, or just a flag to indicate the I don't want to show untracked files.

Thank you.

Abort: Authorization Failed [Code: 255]

I am using absolutely true credientials but mercurial tortoise or cmd cannot authorize me somehow. I am using the same credientials on netbeans and it works just as it needs to.

Any idea ?

VS Code Multi-root Workspaces and Hg Support

Hi,

I'm from the VS Code team [we have chatted before :)] and I'm reaching out with some additional resources for adopting multi-root workspaces.

But first let me say thank you for working on and maintaining Hg/Mecurial Support for VS Code, we really appreciate the work you have done to make VS Code better.

The purpose of this issue is that we are very close to releasing a significant new feature for VS Code - Multi-root Workspaces - which is the most requested missing feature. If you have not heard of multi-root workspaces we have described this in several of our recent updates. Today it's only enabled in our insiders release but our intent is to enable it for all users in our next update, targeted for release in the first week of November.

This is a pretty significant change and over the last four months we have updated pretty much all of VS Code to be Multi-root aware as well as updated all of our own extensions. In the process of doing this we have created a set of guidelines for Extension Authors to follow to ensure their extension can fully leverage the awesomeness that is Multi-root workspaces.

Our Request:

There are a few things to review in your extension to ensure it can fully capitalize on Multi-root Workspaces....

  • Check you do not make use of the (now deprecated) workspace.rootPath property, there is a proposed migration path and sample for this case.
  • Review any settings you contribute or change, specifically you need to review whether some of the settings can be applied on a resource (= file location) level instead of being global (= workspace level).

How Can We Help/Resources:

We realize we are asking for your help here - our goal is to make sure that your extensions works well with multi-root and continues to be loved by the community. The guide above outlines the changes that are required and we have a samples as well.

But we are sure you will have questions and we thought one way we could look to help is by getting a number of the team members (myself included) to be ready to respond to questions on a Slack Channel that we will dedicate to this issue. To join that channel simply follow this link.

Again thank you for being part of the VS Code community - we appreciate everything you have done. With the release of Multi-root Workspaces we will be shipping our most requested feature, together we can really help this feature light up for users.

Happy Coding!
Sean McBreen

p.s. we are also working on some additional cool SCM features - specifically SCM Status in the Explorer and Inline SCM Actions more details on these will be included in the next release.

// cc @bpasero @joaomoreno

Problem with pretxncommit hook

I'm using pretxncommit hook in my project, and it's execution might take a while (typical commit takes ~30 seconds for me). So when I commit with this extension, it start processing with animation, but it never stops. If I manually press the refresh button, it remove commited files from changes, but animation is still in progress and commit message stays on.

Unable to show file history

  1. Command palette
  2. Hg: Show file history
  3. Select revision
  4. Get the error: Unable to open 'file.name (#574 vs. local)': Unexpected token e in JSON at position 0.

VS Code: 1.24.1
HG extension: 1.2.3
Mercurial: 4.4.2

Bad diff result on a file encoded with win1252 charset

Hello,
The diff detects falses differences when the file is win1252 encoded.
The left side is open with UTF8 mode, the right side is open with win1252 mode.
My file is correctly encoded in win1252 and vscode is correctly configured to open files in win1252 mode.

That Is a show stopper.

Thanks,
Denis.

Support for "current branch" workflow

Version: 1.0.4
Thanks for the great extension, really liking it so far!

I'd like to request an option to be added that allows for the following:

  • Push command will only push the current branch hg push -r .
  • The "changes" counter (in the status bar next to the current branch name) only shows the outstanding commit to be pushed / pulled from the current branch and clicking on it will only pull / push the current branch.

The reason behind this is that I do make commits to different branches frequently, but when I decide push I only want to push the branch I am currently on. So I never just hg push, always hg push -r ..

Can't commit message containing non-ascii chars

Hi.

Thanks for great plugin - it's very easy for use.
When I try to commit with message like 'Поправил загрузку Roboto в стилях' - plugin can't do it.

Here is the log:

hg commit style.css -m Поправил загрузку Roboto в стилях
transaction abort!
rollback completed
abort: decoding near 'Попра': 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)!

Do not check files outside of the hg root

I noticed that the extension runs the following for files opened by vscode, including those that are not in the repo, e.g.
"<InstallDir>\hg.exe" cat ../../Users/AJ/AppData/Roaming/Code/User/settings.json

This will return a (silent) error so perhaps it's worth excluding the check for any files that are not under hg root.

Also, these hg cat commands are not logged in the Output window, is that intentional?

Phases are ignored on push

Consider a history like this

* [draft]  commit-to-be-pushed
|
x [public] ...
|
|  * [secret] commit not to be pushed
 /
|
x [public]

With standard hg, you can push this without any issue. However, vscode-hg is ignoring the secret phase and gives me a warning about multiple heads and that I should merge before pushing.

Using Bookmarks AND Branches together

It may not be normal, but i'm using both Bookmarks AND Branches.

HG supports this workflow fine. But the plugin doesn't seem to from what I can see.

Thanks.

Multiline message commit

Hi all,
I think it is a good thing make the possible to write a multiline message for commit.
I see that the message is in one line (the ENTER command is used for confirm the commit).
However, a workaround is also welcome!

Thank you

image

How to implement precommit hook?

I'm trying to figure how to implement a precommit hook for vscode but I've found it quite difficult to grasp. There seem to be simple to use libraries for .git based projects but for .hg it's kind of a mess or always abandoned/out of date.

Subfolders as multi-root

If project having structure:
root folder with .hg

  • subfolder with another .hg

and trying to flatten subrepositories as folders in workspace as

  • root repo
  • sub repo

extension is not detecting them as separate scm entities.

Conflict with blackbox extension

Turning on the Mercurial blackbox logging extension causes vscode to run its hg status* commands in a tight loop, noticeable by the flashing blue badge on the Source Control icon in the Activity Bar.

The extension writes its log files in the repo's .hg folder, perhaps that triggers this behavior?

*
hg status -C
hg cat <filename> (multiple times)
hg summary -q
hg bookmarks

Correctly adopt multirepo SCM

Since upgrading to VSCode 1.16.0, which supports multiple SCM providers, I'm having issues with the vscode-hg. extension. It attempts to track uncommitted files even for Git projects, which causes the SCM badge to show 99+ even though all my changes have been committed.

The VSCode developers claim this is definitely an issue with this extension and not VSCode (for reference, please see microsoft/vscode#34313).

Unable to diff files in latest VS Code.

Command palette

Hg: Show file history
Select revision
Get the error: "Unable to open '.cpp (#7141 vs. local)': Unexpected token f in JSON at position 2."

After some digging I found the string "97f25e8aa98c669e6f26ea2efa090e55da3583a0" is being passed to JSON.parse() in fromHgUri().

Visual Code: 1.18.1
Hg Extension: 1.2.3
Hg: 3.7.3

Skip server checks by default

I'm on Windows, and I don't have pagent running at all times. What happens is that some repositories will thus greet me with a "PuTTY Fatal Error: Disconnected: No supported authentication methods available (server sent: publickey)" or I get asked for my password all the time. However, I don't need the plugin to check those repositories, so ideally I'd like a global setting to turn off the checks at the beginning, with a per-repository override. This seems to be the hg.autoInOut option, which I think should be off by default.

Alternatively, if the initial request fails, a dialog option showing "Error, couldn't get remote repository status. Do you want to keep checking? [yes, no]" would be great, which just turns off that setting. This way, the error message appears only once.

Gutter status shows incoming/outgoing numbers as double the actual amount

Running v1.2.2-3, but I think it's been a problem since I started using it.

For example, in a repo where I have 2 incoming and 3 outgoing changesets, the gutter will display 4↓ 6↑.

It looks like it happens because I've extensively customized formatting in my .hgrc (well, mercurial.ini since I'm on Windows). I recommend setting the HGPLAIN env var when the plugin invokes hg, see https://www.mercurial-scm.org/repo/hg/help/environment (and running vscode with this var set actually fixes the problem for me).

image

Conflicts with git extension

It seems like the Mercurial extension breaks the git SCM provider from marking changes in the gutter. I started noticing this with VSCode 1.16.0, when multiple SCM provider support was added. https://code.visualstudio.com/updates/v1_16#_source-control

  • VSCode Version: 1.16.0
  • OS Version: Windows 10

Steps to Reproduce:

  1. Install the Mercurial extension.
  2. Open a project that uses a git repo.
  3. Edit some files. The git sidebar pane detects the changes, but they are not marked in the gutter.
  4. Disable the Mercurial extension and the git gutter markers come back.

Reproduces without extensions: No

Discard changes for one file discards all of the changes in mercurial

  • VSCode Version: 1.19.2
  • OS Version: Ubuntu 16.04 LTS

Steps to Reproduce:

  1. Have a repo setup using mercurial
  2. Add mercurial (Hg) SCM Provider from the Source Control menu
  3. Make a change to two files
  4. In the Source Control menu click discard icon next to one of the files
  5. In the prompt window asking if you want to confirm discarding changes for this file click "Discard Changes"

Once you do this changes to all files are discarded.

Does this issue occur when all extensions are disabled?: Yes/No
When I open code with --disable-extensions flag I don't see any file changes in Source Control panel only message: "There are no active source control providers"

Incoming/outgoing changeset indicators do not reset after external pull/push

If there are incoming or outgoing changesets pending (and shown on the status bar) and the user subsequently runs a hg pull or hg push, the indicators do not reset.

The extension still runs these commands periodically, which return nothing (as expected):

hg incoming -q -T {rev}:{node}:{join(bookmarks,'\t')}\n
hg outgoing -q -T {rev}:{node}:{join(bookmarks,'\t')}\n

Temporary / SCM files are passed to the linter

For some reason files that don't exist are being passed to the linter, which causes a mess of spurious errors to show up in the problems tab.

For example if I have a file /repos/inv-serve/bin/invsrv, I will then get a linter file called 'invsrv.hg' that is located at hg-original:/repos/inv-serve/bin/invsrv.hg?%7B%22path%22%3A%22%2Frepos%2Finv-serve%2Fbin%2Finvsrv%22%3A%22%22%7D, and of course the linter spectacularly fails on this file and produces tons of problems.

Bookmark update issues with hg.pushPullScope = "current"

I am running into some issues when using the following settings:

"hg.useBookmarks": true
"hg.pushPullScope": "current"

If you are working in bookmark A and want to update to bookmark B, the expected workflow would be to run Hg: Pull followed by Hg: Update to... (bookmark B). However, if there are new revisions to bookmark B on the master, you don't see these since the Pull command only pulled changes for bookmark A. You need to run Hg: Pull again to see the latest changes for bookmark B.

Secondly, if a new bookmark C is created on the master it will not show up in the Hg: Update to... list, even after running Hg: Pull.

Not entirely sure how to address this, perhaps the output from hg incoming -q --bookmarks could be used to update the list of available bookmarks, including revisions that are not yet pulled (and pull the selected revision if necessary)?

Gutter change indicators missing

VSCode: 1.17.2
Hg: 4.0
vscode-hg: 1.2.0

Issue:
The Hg change indicators are missing from the gutter. Not quite sure when this started happening, but it wasn't that long ago. The Git scm provider still shows them (on a different workspace). Everything else seems to be working. The badge on the left counts the changed files, the diffs show as normal and the status bar shows the current branch and the upstream push/pull count.
The output for hg looks pretty normal:

Using hg 4.0 from C:\Program Files\TortoiseHg\hg.exe
hg root
hg paths
hg summary -q
hg root
abort: no repository found in 'c:\Users\default\AppData\Roaming\Code\User' (.hg not found)!

hg branch
hg status -C
hg summary -q
hg branch
hg status -C

Any pointers as to what might have gone wrong?

Allow setting revision to diff against

My workflow is something like..

# <change file A>
hg commit -m "msg"
# <change file B>
hg amend
# <change file C>
hg amend

So I would like to specify a revision to diff against, for example .^ or my_tag

Is it possible to add this option?

PowerShell session crashes when viewing diff

Repro:

  • Install PowerShell extension
  • Commit a .ps1 file to a hg repo
  • Make a change to the file and save
  • In the SCM side bar, click on the file (or select Open Changes from the context menu)
  • vscode shows the diff but a second later the PowerShell session terminates and prompts to restart

The PowerShell extension debug logs mention a "Illegal characters in path" error. The error does not occur when using the git SCM provider.

Add color argument when invoking hg [Was: Mercurial update breaks the plugin]

On an Ubuntu 16.04 using Visual Studio Code 1.19.2 and Hg extension v1.2.2-3, updating the system's mercurial from 3.7.3 to 4.4.1 using official PPA results in an empty Source Control area in side bar.

There are no modified or untracked files, the source control is recognized as "HG".

Using mercurial in command line works without flaws.

Reverting to previous version fixes the issue.

Changeset descriptions are truncated at the first colon (:)

The changeset descriptions shown in the “Hg: Log…” and “Hg: Show file history…” commands is truncated at the first colon (:) in the description. For example a changeset description of the form:

Bug 12345: Short, fewer than 80 characters, summary

Fuller description. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec luctus luctus tincidunt. Integer convallis volutpat nunc, quis hendrerit ante dictum sit amet. Mauris et pretium purus, nec ultrices leo. Proin aliquet quis mauris in ultricies. Duis vel ex lacinia, aliquam ligula pellentesque, facilisis diam.

Shows as just "Bug 12345" it would be useful to see the full changeset description or optionally (by adding a configuration option) just the first line (i.e. like hg log --template "{desc|firstline}\n")

I’m guessing it is because getLogEntries() uses colons to separate fields in its custom template format. Perhaps move the desc field to the end of the template and treat everything after the sixth colon as changeset description text? Or perhaps simply include colons in the substitution to replace them with spaces?

Serena Dimesions

Hi,
is possible to use your extensions with Serena Dimensions SCM?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.