git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 3/9] remote-bzr: fix bad state issue

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 26, 2013, 00:08 UTC
Message-ID
<1366934902-18704-4-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1366934902-18704-1-git-send-email-felipe.contreras@gmail.com>
Carried from remote-hg.

The problem reportedly happened after doing a push that fails, the abort causes the state of remote-hg to go bad, this happens because remote-hg's marks are not stored, but 'git fast-export' marks are.

Ensure that the marks are _always_ stored.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-bzr | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index 87c54bf..7b6584e 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -32,6 +32,7 @@ import os
 import json
 import re
 import StringIO
+import atexit
 
 NAME_RE = re.compile('^([^<>]+)')
 AUTHOR_RE = re.compile('^([^<>]+?)? ?<([^<>]*)>$')
@@ -728,6 +729,7 @@ def main(args):
     blob_marks = {}
     parsed_refs = {}
     files_cache = {}
+    marks = None
 
     gitdir = os.environ['GIT_DIR']
     dirname = os.path.join(gitdir, 'bzr', alias)
@@ -754,6 +756,10 @@ def main(args):
             die('unhandled command: %s' % line)
         sys.stdout.flush()
 
+def bye():
+    if not marks:
+        return
     marks.store()
 
+atexit.register(bye)
 sys.exit(main(sys.argv))
-- 
1.8.2.1.884.g3532a8d
Previous: Felipe ContrerasNext: Felipe Contreras
Message 4 of 13 in “remote-helpers: fixes and cleanups”
  1. 0/9 remote-helpers: fixes and cleanupsFelipe Contreras, Apr 26, 2013
  2. 1/9 remote-helpers: trivial cleanupsFelipe Contreras, Apr 26, 2013
  3. 2/9 remote-hg: remove extra checkFelipe Contreras, Apr 26, 2013
  4. 3/9 remote-bzr: fix bad state issueFelipe Contreras, Apr 26, 2013
  5. 4/9 remote-bzr: add support to push URLsFelipe Contreras, Apr 26, 2013
  6. 5/9 remote-hg: use hashlib instead of hg sha1 utilFelipe Contreras, Apr 26, 2013
  7. 6/9 remote-bzr: store converted URLFelipe Contreras, Apr 26, 2013
  8. John SzakmeisterApr 26, 2013
  9. Felipe ContrerasApr 26, 2013
  10. 7/9 remote-bzr: tell bazaar to be quietFelipe Contreras, Apr 26, 2013
  11. John SzakmeisterApr 26, 2013
  12. 8/9 remote-bzr: strip extra newlineFelipe Contreras, Apr 26, 2013
  13. 9/9 remote-bzr: use proper push methodFelipe Contreras, Apr 26, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.