How to detect that commits are pushable

In Git, this is easy because remote/branch points to a different commit than branch . How to do this with Mercurial?

+4
source share
6 answers

With Mercurial 2.1 there is also a purely local solution: phases . The draft phase is probably what you are looking for. For more information see:

https://www.mercurial-scm.org/wiki/Phases

You can find interesting hg phase <rev> and hg log -r "draft()" .

+1
source

If you mean the difference between your local repo and the one you click on, try

 hg outgoing 
+7
source

There is a remotebranch extension that will give you a Git installation. It tracks the remote heads for the repositories listed in [paths] , and provides them as tags with the name <path>/<branch> . This allows you to run

 $ hg diff -r foo/default 

to see what has changed from the default branch in the foo repository. In addition, there are new keywords that let you do things like

 $ hg log -r "not pushed()" 

to get what

 $ hg outgoing 

but without network traffic.

+2
source

I would just use hg outgoing , as others suggest, but hg summary will tell you too. The --remote option may be required to test it on a remote server by default.

+1
source

If you need to select a set of changes for further processing, you can use the outgoing deferral predicate . This allows you to hg outgoing as

 hg log -r "outgoing()" 

but the real benefit is that you can use this in other contexts, for example

 hg strip "outgoing()" 
+1
source

What will cause the command line to display all the changes in the draft project?

 hg log --style phases 

This will display the log + phase since Mercurial 2.7 (2013-08-01) .

+1
source

Source: https://habr.com/ru/post/1383055/


All Articles