Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is "hg push" so much bigger than .hg?

Tags:

mercurial

My project's .hg directory is 40MB. If I hg push --verbose --debug to an empty remote repository I see it sending hundreds of MBs. Where is the extra overhead coming from?

UPDATE: hg bundle -a generates a 35MB file. Here is a stripped-down version of the output I'm seeing:

pushing to https://jace.googlecode.com/hg/
using https://jace.googlecode.com/hg/
sending between command
using auth.default.* for authentication
jace.googlecode.com certificate successfully verified
sending capabilities command
using auth.default.* for authentication
capabilities: branchmap lookup unbundle=HG10UN,HG10UGZ,HG10BZ changegroupsubset
sending heads command
using auth.default.* for authentication
searching for changes
common changesets up to 71818a195bf5
sending branchmap command
[...]
bundling: <filenames>
sending unbundle command
sending xxx bytes
[...]
sending: xxx/xxx kb
like image 635
Gili Avatar asked Jun 30 '11 19:06

Gili


People also ask

What does hg commit do?

hg commit: save your changes in the current repository. hg log: see all changes in your repository. hg pull: get all changes from another repository into the current one. hg push: get all changes from your repository into another one.

What is hg graft?

Description. This command uses Mercurial's merge logic to copy individual changes from other branches without merging branches in the history graph. This is sometimes known as 'backporting' or 'cherry-picking'. By default, graft will copy user, date, and description from the source changesets.

What is hg tip?

Use the hg heads command to list the heads of the current repository. The tip is the changeset added to the repository most recently. If you have just made a commit, that commit will be the tip. Alternately, if you have just pulled from another repository, the tip of that repository becomes the new tip.


2 Answers

This is a known python bug. Because of the way the python http library work, it first sends the data, the server replies that it needs an auth, and it resends the data.

With a recent mercurial (starting at 1.9) you can use an alternative http library. Just add the following in hgrc:

[ui]
usehttp2 = true
like image 130
tonfa Avatar answered Nov 15 '22 08:11

tonfa


It could be that the repository you're pushing to doesn't support compressed transfer. What protocol are you using? If it's http, I recommend you watch the first requests to the remote repository (one of them is about determining the capabilities the remote repo offers).

If you're using a file URL for pushing, there's probably not much you can do about it.

like image 29
Johannes Rudolph Avatar answered Nov 15 '22 09:11

Johannes Rudolph