bagklion.blogg.se

Tortoisehg tag vs bookmark
Tortoisehg tag vs bookmark













Not quite as helpful as the message in Ilia’s case, but still letting me know something about the request was invalid. Sticking a breakpoint in the error handling code, I was able to break into a pdb session and inspect the error: (Pdb) inst.read() ‘400 Bad request\nYour browser sent an invalid request.\n\n\n’

#TORTOISEHG TAG VS BOOKMARK TRIAL#

After some trial and error and setting breakpoints here and there and inspecting the call stack, I eventually found the where the request was actually failing ( ._callstream): req = urllib2.Request(cu, data, headers) if data is not None: self.ui.debug(“sending %s bytes\n” % size) req.add_unredirected_header(‘Content-Length’, ‘%d’ % size) try: resp = (req) except urllib2.HTTPError, inst: if de = 401: raise util.Abort(_(‘authorization failed’)) raise So, (luckily) being quite familiar with Python, I decided to dig into the source to figure out what’s going on. In my case, it wasn’t easy to debug against the repo in question as it was over HTTPS and I didn’t have access to the private keys, so ssldump was useless as I couldn’t decrypt application data and therefore couldn’t see the application errors to ensure they were the same. In my search, I came across this blog post by Ilia Barahovsky that eventually led me down the right path. My first stop was Google, something to the effect of “mercurial abort HTTP Error 400: Bad request”. I assume that this would also hold true for the general Mercurial user base. Running with the - debug and - vv flags yielded the following: - - p/cpython » hg pull - debug -vv using sending capabilities command using /Library/Python/2.7/site-packages/mercurial/dummycert.pem to enable OS X system CA hg. certificate successfully verified pulling from preparing listkeys for “bookmarks” sending listkeys command preparing listkeys for “bookmarks” sending listkeys command query 1 heads sending batch command searching for changes taking initial sample searching: 2 queries query 2 still undecided: 10624, sample size is: 200 sending known command abort: HTTP Error 400: Bad requestīeing horribly ignorant of Mercurial internals, this didn’t help at all as I had no understanding of what any of these meant. On a subsequent pull from remote, I ran into the following error: - - p/cpython » hg pull pulling from searching for changes abort: HTTP Error 400: Bad request Once I’d completed work on the first issue, my local repo history looked like this: - - p/cpython » hg log -Gl3 changeset: 93820:75b2bdafffe7 | bookmark: issue21793 | tag: tip | parent: 93818:0050e770b34c | user: Demian Brecht | date: Wed Dec 10 15:47:13 2014 -0800 | summary: issue21793 | | o changeset: 93819:aeeec8a4b9b8 | | branch: 2.7 | | parent: 93816:e0129395724d | | user: Serhiy Storchaka | | date: Wed Dec 10 23:05:33 2014 +0200 | | summary: Issue #23016: A warning no longer produces an AttributeError when sys.stderr | | o | changeset: 93818:0050e770b34c |\ \ parent: 93815:bf98400daa62 | | | parent: 93817:d04dab84388f | | | user: Serhiy Storchaka | | | date: Wed Dec 10 23:04:47 2014 +0200 | | | summary: Issue #23016: A warning no longer produces an AttributeError when the programĪfter reverting to the last public commit from the default branch (93818) and committing my work, my local history looked like this. The problemĪs written in the Mercurial for git developers guide, I had finished working on one bookmarked issue (spoiler: bookmarks have nothing to do with the problem) and had started to work on another. This is a walkthrough of how I solved the immediate problem I was facing, but in detailing the steps taken, I’m hopeful that it will help others diagnose similar but different issues as well. While the details here are specific to the issue that I encountered, the workflow can help sort a number of errors that may be encountered when using Mercurial over HTTP(S). This post is intended to detail the steps that I took to find the underlying issue and potential solutions. While working on a refactor of my blog post about Mercurial for git developers, I ran into a blocking issue while working on CPython’s hg repo.













Tortoisehg tag vs bookmark