dusty-phillips / gitifyhg

Tools for using git as a client to mercurial repositories
GNU General Public License v3.0
62 stars 17 forks source link

"Access denied" errors are not handled properly #66

Open fingolfin opened 11 years ago

fingolfin commented 11 years ago

I just had an odd experienced where I did a "git push" via gitifyhg to a hg repository, and no errors were reported. Yet when I tried to pull the changes in a hg clone of the same repository, no changes arrived. I repeated this two more times (each time adding another commit), still nothing.

I finally went into .git/hg/*/clone and issued a "hg push" there, only to get this message"

pushing to ssh://hg@some.server/repos
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 3 changesets with 7 changes to 7 files
remote: error: pretxnchangegroup.access hook failed: mercurialserver.access: access denied for changeset XYZ
remote: transaction abort!
remote: rollback completed
remote: abort: mercurialserver.access: access denied for changeset XYZ

So it seems we should handle access denied errors, and inform the user accordingly. Instead of making it look as if everything succeeded.

alexsydell commented 11 years ago

I think taking care of this TODO would accomplish that: https://github.com/buchuki/gitifyhg/blob/master/gitifyhg/gitexporter.py#L102