Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local-only version of `hg outgoing`?

Tags:

mercurial

The command

hg outgoing

compares the local repo to the default push location; it accesses the push location to do it.

I'd like to ask the question "have I checked in changes in my local repo since my last hg push?" without having to access the remote repo.

It seems like there might be enough info in the local repo to figure that out; if so, is there a command to determine that?

like image 667
Grumdrig Avatar asked Jan 23 '23 00:01

Grumdrig


1 Answers

There isn't a built-in way to do it. Tracking what has been pushed would be slightly tricky because you can push to multiple places. And you can pull from multiple places. So I could push to X then push to Y then pull from Z and my 'hg outgoing X' output is difficult to predict local-only.

That said you could use a command like this:

hg tag --local --force -r tip pushed

That creates a local-only tag pointing to the current tip. If you always run that after pushing you'll always know what was last pushed.

You could create a post-push hook to do that in your .hgrc:

[hook]
post-push = hg tag --local --force -r tip pushed
like image 94
Ry4an Brase Avatar answered Feb 27 '23 10:02

Ry4an Brase