{"thread":{"id":"33612","subject":"[PATCH 00/20] remote-bzr: massive changes","startedAt":"2013-04-26T01:07:48Z","lastAt":"2013-04-29T04:57:21Z","messageCount":29,"participants":["Felipe Contreras","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":20},"messages":[{"id":"215542","messageId":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":null,"subject":"[PATCH 00/20] remote-bzr: massive changes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:48Z","receivedAt":"2013-04-26T01:07:48Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nAfter being contacted by the emacs developers and others who are stuck with\nBazaar, which at this point seems to be utterly abandoned, I realized the\ncurrent implementation is too crude.\n\nBazaar branches are very simplistic, and our support for them is the same; we\nneed to create one remote per branch. This works nicely if you work on small\nprojects with few branches, but doesn't scale.\n\nBig projects like emacs take a lot of space, and creating a remote per branch\nis unrealistic, because each remote will have the whole Bazaar repository\ncopied, wasting space, and time each time a remote (for a bzr branch) is set\nup.\n\nMoreoever, a developer needs to constantly reset the master branch to the\ncommit he/she wants to push before pushing, since the transport-helper\ninfraestructure doesn't support pushing with refspecs (xwidget:master).\n\nThat is of course, if pushing actually worked (which in many cases doesn't).\n\nIn short, our support for real-world projects suck.\n\nThese patches fix all the issues I encountrered.\n\n 1) First of all, there are several improvements for pushing. Before, we failed\n    when trying to push a merge, now, even tricky merges work.\n \n 2) Secondly, bzr branches are tied to a transport, so they time out if not\n    used for a period of time, and importing/exporting huge chunks of a\n    repository do take some time. So now they are only opened when they are\n    about to be used.\n\n 3) Then the big one; now bzr repositories are supported. They are very simple:\n    basically an object store with no notion of branches, so to find the\n    branches we need to traverse a directory (sometimes) remote, to find them.\n    This is how Bazaar does it, ableit very slowly. Naturally, a lot of code\n    had to be changed to support more than one branch.\n\n 4) In addition, now remotes share all the objects, so adding a new remote\n    doesn't imply fetchng a bunch of duplicated objects. They are just re-used\n    automagically.\n\n 5) Since the bzr objects are shared now, it only makes sense to share the\n    remote-bzr marks, so we don't have to fast-import them again.\n\n 6) The code was also reorganized to keep referenced as few objects as\n    possible, since Bazaar seems to be need *a ton* of memory for them.\n\nFinally, after all these changes I was finally able to clone the whole emacs\nrepository, all 130685 commits, and 56 branches without running out of memory\nin my modest laptop.\n\nSince the purpose of remote-bzr is to actually be usable for the poor souls\nstucks in DSCMs that are not git, these changes are a must. I propose they be\nmerged for the next major version of git (v1.8.3) if no issues are found. They\nchanges pass all the tests, and work on various repositories I've tried. I'll\nask the emacs developers to give them a try, and let's see how it goes.\n\nCheers.\n\nFelipe Contreras (20):\n  remote-bzr: cleanup CustomTree\n  remote-bzr: delay blob fetching until the very end\n  remote-bzr: fix order of locking in CustomTree\n  remote-bzr: always try to update the worktree\n  remote-bzr: add support to push merges\n  remote-bzr: fixes for branch diverge\n  remote-bzr: fix partially pushed merge\n  remote-bzr: use branch variable when appropriate\n  remote-bzr: add support for bzr repos\n  remote-bzr: fix branch names\n  remote-bzr: add support for shared repo\n  remote-bzr: split marks file\n  remote-bzr: improve author sanitazion\n  remote-bzr: add custom method to find branches\n  remote-bzr: add option to specify branches\n  remote-bzr: improve progress reporting\n  remote-bzr: iterate revisions properly\n  remote-bzr: delay peer branch usage\n  remote-bzr: access branches only when needed\n  remote-bzr: export HEAD\n\n contrib/remote-helpers/git-remote-bzr | 365 +++++++++++++++++++++++++---------\n contrib/remote-helpers/test-bzr.sh    |  36 ++++\n 2 files changed, 302 insertions(+), 99 deletions(-)\n\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215544","messageId":"1366938488-25425-2-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 01/20] remote-bzr: cleanup CustomTree","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:49Z","receivedAt":"2013-04-26T01:07:49Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"This code was not used at all.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 8 +-------\n 1 file changed, 1 insertion(+), 7 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex c19ed0e..7452a57 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -385,9 +385,6 @@ class CustomTree():\n     def __init__(self, repo, revid, parents, files):\n         global files_cache\n \n-        self.repo = repo\n-        self.revid = revid\n-        self.parents = parents\n         self.updates = {}\n \n         def copy_tree(revid):\n@@ -435,7 +432,7 @@ class CustomTree():\n             if basename == '':\n                 return None\n             fid = bzrlib.generate_ids.gen_file_id(path)\n-            d = add_entry(fid, dirname, 'directory')\n+            add_entry(fid, dirname, 'directory')\n             return fid\n \n         def add_entry(fid, path, kind, mode = None):\n@@ -458,7 +455,6 @@ class CustomTree():\n                     (None, executable))\n             self.files[path] = change[0]\n             changes.append(change)\n-            return change\n \n         def update_entry(fid, path, kind, mode = None):\n             dirname, basename = os.path.split(path)\n@@ -480,7 +476,6 @@ class CustomTree():\n                     (None, executable))\n             self.files[path] = change[0]\n             changes.append(change)\n-            return change\n \n         def remove_entry(fid, path, kind):\n             dirname, basename = os.path.split(path)\n@@ -495,7 +490,6 @@ class CustomTree():\n                     (None, None))\n             del self.files[path]\n             changes.append(change)\n-            return change\n \n         for fid, f in self.updates.iteritems():\n             path = f['path']\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215545","messageId":"1366938488-25425-3-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 02/20] remote-bzr: delay blob fetching until the very end","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:50Z","receivedAt":"2013-04-26T01:07:50Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Might be more efficient, but the real reason to use the marks will be\nrevealed in upcoming patches.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 8 +++++---\n 1 file changed, 5 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 7452a57..91b5cda 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -506,10 +506,12 @@ class CustomTree():\n         return changes\n \n     def get_file_with_stat(self, file_id, path=None):\n-        return (StringIO.StringIO(self.updates[file_id]['data']), None)\n+        mark = self.updates[file_id]['mark']\n+        return (StringIO.StringIO(blob_marks[mark]), None)\n \n     def get_symlink_target(self, file_id):\n-        return self.updates[file_id]['data']\n+        mark = self.updates[file_id]['mark']\n+        return blob_marks[mark]\n \n def c_style_unescape(string):\n     if string[0] == string[-1] == '\"':\n@@ -553,7 +555,7 @@ def parse_commit(parser):\n         if parser.check('M'):\n             t, m, mark_ref, path = line.split(' ', 3)\n             mark = int(mark_ref[1:])\n-            f = { 'mode' : m, 'data' : blob_marks[mark] }\n+            f = { 'mode' : m, 'mark' : mark }\n         elif parser.check('D'):\n             t, path = line.split(' ')\n             f = { 'deleted' : True }\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215543","messageId":"1366938488-25425-4-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 03/20] remote-bzr: fix order of locking in CustomTree","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:51Z","receivedAt":"2013-04-26T01:07:51Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"It doesn't seem to make any difference, but revision_tree() requires a\nlock.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 91b5cda..b428244 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -389,8 +389,8 @@ class CustomTree():\n \n         def copy_tree(revid):\n             files = files_cache[revid] = {}\n-            tree = repo.repository.revision_tree(revid)\n             repo.lock_read()\n+            tree = repo.repository.revision_tree(revid)\n             try:\n                 for path, entry in tree.iter_entries_by_dir():\n                     files[path] = entry.file_id\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215546","messageId":"1366938488-25425-5-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 04/20] remote-bzr: always try to update the worktree","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:52Z","receivedAt":"2013-04-26T01:07:52Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"And fail properly when we can't.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex b428244..eb91d28 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -641,9 +641,13 @@ def do_export(parser):\n                 except bzrlib.errors.DivergedBranches:\n                     print \"error %s non-fast forward\" % ref\n                     continue\n-            else:\n+\n+            try:\n                 wt = repo.bzrdir.open_workingtree()\n                 wt.update()\n+            except bzrlib.errors.NoWorkingTree:\n+                pass\n+\n         print \"ok %s\" % ref\n \n     print\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215547","messageId":"1366938488-25425-6-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 05/20] remote-bzr: add support to push merges","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:53Z","receivedAt":"2013-04-26T01:07:53Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"In order to do that, we need to store the marks of every file, so that\nthey can be fetched when needed. Unfortunately we can't tell bazaar that\nnothing changed, we need to send the data so that it can figure it out\nby itself.\n\nAnd since it will be requesting a bunch of information by the file_id,\nit's better to have a helper dict (rev_files), so that we can fetch it\nquickly.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 29 ++++++++++++++++++++--------\n contrib/remote-helpers/test-bzr.sh    | 36 +++++++++++++++++++++++++++++++++++\n 2 files changed, 57 insertions(+), 8 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex eb91d28..6a7f836 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -393,7 +393,7 @@ class CustomTree():\n             tree = repo.repository.revision_tree(revid)\n             try:\n                 for path, entry in tree.iter_entries_by_dir():\n-                    files[path] = entry.file_id\n+                    files[path] = [entry.file_id, None]\n             finally:\n                 repo.unlock()\n             return files\n@@ -408,12 +408,18 @@ class CustomTree():\n                 self.base_files = copy_tree(self.base_id)\n \n         self.files = files_cache[revid] = self.base_files.copy()\n+        self.rev_files = {}\n+\n+        for path, data in self.files.iteritems():\n+            fid, mark = data\n+            self.rev_files[fid] = [path, mark]\n \n         for path, f in files.iteritems():\n-            fid = self.files.get(path, None)\n+            fid, mark = self.files.get(path, [None, None])\n             if not fid:\n                 fid = bzrlib.generate_ids.gen_file_id(path)\n             f['path'] = path\n+            self.rev_files[fid] = [path, mark]\n             self.updates[fid] = f\n \n     def last_revision(self):\n@@ -423,10 +429,10 @@ class CustomTree():\n         changes = []\n \n         def get_parent(dirname, basename):\n-            parent_fid = self.base_files.get(dirname, None)\n+            parent_fid, mark = self.base_files.get(dirname, [None, None])\n             if parent_fid:\n                 return parent_fid\n-            parent_fid = self.files.get(dirname, None)\n+            parent_fid, mark = self.files.get(dirname, [None, None])\n             if parent_fid:\n                 return parent_fid\n             if basename == '':\n@@ -453,7 +459,7 @@ class CustomTree():\n                     (None, basename),\n                     (None, kind),\n                     (None, executable))\n-            self.files[path] = change[0]\n+            self.files[path] = [change[0], None]\n             changes.append(change)\n \n         def update_entry(fid, path, kind, mode = None):\n@@ -474,7 +480,7 @@ class CustomTree():\n                     (None, basename),\n                     (None, kind),\n                     (None, executable))\n-            self.files[path] = change[0]\n+            self.files[path] = [change[0], None]\n             changes.append(change)\n \n         def remove_entry(fid, path, kind):\n@@ -503,16 +509,23 @@ class CustomTree():\n             else:\n                 add_entry(fid, path, 'file', f['mode'])\n \n+            self.files[path][1] = f['mark']\n+            self.rev_files[fid][1] = f['mark']\n+\n         return changes\n \n     def get_file_with_stat(self, file_id, path=None):\n-        mark = self.updates[file_id]['mark']\n+        path, mark = self.rev_files[file_id]\n         return (StringIO.StringIO(blob_marks[mark]), None)\n \n     def get_symlink_target(self, file_id):\n-        mark = self.updates[file_id]['mark']\n+        path, mark = self.rev_files[file_id]\n         return blob_marks[mark]\n \n+    def id2path(self, file_id):\n+        path, mark = self.rev_files[file_id]\n+        return path\n+\n def c_style_unescape(string):\n     if string[0] == string[-1] == '\"':\n         return string.decode('string-escape')[1:-1]\ndiff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh\nindex 34666e1..eca3476 100755\n--- a/contrib/remote-helpers/test-bzr.sh\n+++ b/contrib/remote-helpers/test-bzr.sh\n@@ -228,4 +228,40 @@ test_expect_success 'push utf-8 filenames' '\n   test_cmp expected actual\n '\n \n+test_expect_success 'pushing a merge' '\n+  mkdir -p tmp && cd tmp &&\n+  test_when_finished \"cd .. && rm -rf tmp\" &&\n+\n+  (\n+  bzr init bzrrepo &&\n+  cd bzrrepo &&\n+  echo one > content &&\n+  bzr add content &&\n+  bzr commit -m one\n+  ) &&\n+\n+  git clone \"bzr::$PWD/bzrrepo\" gitrepo &&\n+\n+  (\n+  cd bzrrepo &&\n+  echo two > content &&\n+  bzr commit -m two\n+  ) &&\n+\n+  (\n+  cd gitrepo &&\n+  echo three > content &&\n+  git commit -a -m three &&\n+  git fetch &&\n+  git merge origin/master || true &&\n+  echo three > content &&\n+  git commit -a --no-edit &&\n+  git push\n+  ) &&\n+\n+  echo three > expected &&\n+  cat bzrrepo/content > actual &&\n+  test_cmp expected actual\n+'\n+\n test_done\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215548","messageId":"1366938488-25425-7-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 06/20] remote-bzr: fixes for branch diverge","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:54Z","receivedAt":"2013-04-26T01:07:54Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"If the branches diverge we want to reset the pointer to where the remote\nactually is. Since we can access remote branches just as easily as local\nones, let's do so.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 6a7f836..bf254a0 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -354,6 +354,7 @@ def do_import(parser):\n     if os.path.exists(path):\n         print \"feature import-marks=%s\" % path\n     print \"feature export-marks=%s\" % path\n+    print \"feature force\"\n     sys.stdout.flush()\n \n     while parser.check('import'):\n@@ -716,7 +717,12 @@ def get_repo(url, alias):\n             # pull\n             d = bzrlib.bzrdir.BzrDir.open(clone_path)\n             branch = d.open_branch()\n-            result = branch.pull(remote_branch, [], None, False)\n+            try:\n+                result = branch.pull(remote_branch, [], None, False)\n+            except bzrlib.errors.DivergedBranches:\n+                # use remote branch for now\n+                peer = None\n+                return remote_branch\n         else:\n             # clone\n             d = origin.sprout(clone_path, None,\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215550","messageId":"1366938488-25425-8-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 07/20] remote-bzr: fix partially pushed merge","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:55Z","receivedAt":"2013-04-26T01:07:55Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"If part of the merge was already pushed, we don't have the blob_marks\navailable, however, the commits are already stored in bazaar, so we can\nuse the revision_tree to fetch the contents.\n\nWe want to do this only when there's no other option.\n\nThere's no easy way to test this.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 17 +++++++++++++----\n 1 file changed, 13 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex bf254a0..fdead31 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -387,6 +387,7 @@ class CustomTree():\n         global files_cache\n \n         self.updates = {}\n+        self.branch = repo\n \n         def copy_tree(revid):\n             files = files_cache[revid] = {}\n@@ -515,13 +516,21 @@ class CustomTree():\n \n         return changes\n \n-    def get_file_with_stat(self, file_id, path=None):\n+    def get_content(self, file_id):\n         path, mark = self.rev_files[file_id]\n-        return (StringIO.StringIO(blob_marks[mark]), None)\n+        if mark:\n+            return blob_marks[mark]\n+\n+        # last resort\n+        tree = self.branch.repository.revision_tree(self.base_id)\n+        return tree.get_file_text(file_id)\n+\n+    def get_file_with_stat(self, file_id, path=None):\n+        content = self.get_content(file_id)\n+        return (StringIO.StringIO(content), None)\n \n     def get_symlink_target(self, file_id):\n-        path, mark = self.rev_files[file_id]\n-        return blob_marks[mark]\n+        return self.get_content(file_id)\n \n     def id2path(self, file_id):\n         path, mark = self.rev_files[file_id]\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215549","messageId":"1366938488-25425-9-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 08/20] remote-bzr: use branch variable when appropriate","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:56Z","receivedAt":"2013-04-26T01:07:56Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"There should be no functional changes. Basically we want to reserve the\n'repo' variable.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 35 ++++++++++++++++++-----------------\n 1 file changed, 18 insertions(+), 17 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex fdead31..0c67236 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -257,7 +257,8 @@ def export_branch(branch, name):\n     tip = marks.get_tip(name)\n \n     repo = branch.repository\n-    repo.lock_read()\n+\n+    branch.lock_read()\n     revs = branch.iter_merge_sorted_revisions(None, tip, 'exclude', 'forward')\n     count = 0\n \n@@ -325,7 +326,7 @@ def export_branch(branch, name):\n             print \"progress revision %s (%d/%d)\" % (revid, count, len(revs))\n             print \"#############################################################\"\n \n-    repo.unlock()\n+    branch.unlock()\n \n     revid = branch.last_revision()\n \n@@ -383,21 +384,21 @@ def parse_blob(parser):\n \n class CustomTree():\n \n-    def __init__(self, repo, revid, parents, files):\n+    def __init__(self, branch, revid, parents, files):\n         global files_cache\n \n         self.updates = {}\n-        self.branch = repo\n+        self.branch = branch\n \n         def copy_tree(revid):\n             files = files_cache[revid] = {}\n-            repo.lock_read()\n-            tree = repo.repository.revision_tree(revid)\n+            branch.lock_read()\n+            tree = branch.repository.revision_tree(revid)\n             try:\n                 for path, entry in tree.iter_entries_by_dir():\n                     files[path] = [entry.file_id, None]\n             finally:\n-                repo.unlock()\n+                branch.unlock()\n             return files\n \n         if len(parents) == 0:\n@@ -587,20 +588,20 @@ def parse_commit(parser):\n         path = c_style_unescape(path).decode('utf-8')\n         files[path] = f\n \n-    repo = parser.repo\n+    branch = parser.repo\n \n     committer, date, tz = committer\n     parents = [str(mark_to_rev(p)) for p in parents]\n     revid = bzrlib.generate_ids.gen_revision_id(committer, date)\n     props = {}\n-    props['branch-nick'] = repo.nick\n+    props['branch-nick'] = branch.nick\n \n-    mtree = CustomTree(repo, revid, parents, files)\n+    mtree = CustomTree(branch, revid, parents, files)\n     changes = mtree.iter_changes()\n \n-    repo.lock_write()\n+    branch.lock_write()\n     try:\n-        builder = repo.get_commit_builder(parents, None, date, tz, committer, props, revid)\n+        builder = branch.get_commit_builder(parents, None, date, tz, committer, props, revid)\n         try:\n             list(builder.record_iter_changes(mtree, mtree.last_revision(), changes))\n             builder.finish_inventory()\n@@ -609,7 +610,7 @@ def parse_commit(parser):\n             builder.abort()\n             raise\n     finally:\n-        repo.unlock()\n+        branch.unlock()\n \n     parsed_refs[ref] = revid\n     marks.new_mark(revid, commit_mark)\n@@ -653,20 +654,20 @@ def do_export(parser):\n         else:\n             die('unhandled export command: %s' % line)\n \n-    repo = parser.repo\n+    branch = parser.repo\n \n     for ref, revid in parsed_refs.iteritems():\n         if ref == 'refs/heads/master':\n-            repo.generate_revision_history(revid, marks.get_tip('master'))\n+            branch.generate_revision_history(revid, marks.get_tip('master'))\n             if peer:\n                 try:\n-                    repo.push(peer, stop_revision=revid)\n+                    branch.push(peer, stop_revision=revid)\n                 except bzrlib.errors.DivergedBranches:\n                     print \"error %s non-fast forward\" % ref\n                     continue\n \n             try:\n-                wt = repo.bzrdir.open_workingtree()\n+                wt = branch.bzrdir.open_workingtree()\n                 wt.update()\n             except bzrlib.errors.NoWorkingTree:\n                 pass\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215551","messageId":"1366938488-25425-10-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 09/20] remote-bzr: add support for bzr repos","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:57Z","receivedAt":"2013-04-26T01:07:57Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"In bazaar, a repository can contain multiple branches, and previously we\nwere supporting only one branch at a time. Now we fetch them all.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 158 ++++++++++++++++++++++------------\n 1 file changed, 102 insertions(+), 56 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 0c67236..3b33061 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -27,6 +27,7 @@ import bzrlib.generate_ids\n import bzrlib.transport\n import bzrlib.errors\n import bzrlib.ui\n+import bzrlib.urlutils\n \n import sys\n import os\n@@ -250,12 +251,13 @@ def export_files(tree, files):\n \n     return final\n \n-def export_branch(branch, name):\n+def export_branch(repo, name):\n     global prefix\n \n     ref = '%s/heads/%s' % (prefix, name)\n     tip = marks.get_tip(name)\n \n+    branch = branches[name]\n     repo = branch.repository\n \n     branch.lock_read()\n@@ -323,7 +325,7 @@ def export_branch(branch, name):\n \n         count += 1\n         if (count % 100 == 0):\n-            print \"progress revision %s (%d/%d)\" % (revid, count, len(revs))\n+            print \"progress revision %s '%s' (%d/%d)\" % (revid, name, count, len(revs))\n             print \"#############################################################\"\n \n     branch.unlock()\n@@ -348,7 +350,7 @@ def export_tag(repo, name):\n def do_import(parser):\n     global dirname\n \n-    branch = parser.repo\n+    repo = parser.repo\n     path = os.path.join(dirname, 'marks-git')\n \n     print \"feature done\"\n@@ -362,10 +364,10 @@ def do_import(parser):\n         ref = parser[1]\n         if ref.startswith('refs/heads/'):\n             name = ref[len('refs/heads/'):]\n-            export_branch(branch, name)\n+            export_branch(repo, name)\n         if ref.startswith('refs/tags/'):\n             name = ref[len('refs/tags/'):]\n-            export_tag(branch, name)\n+            export_tag(repo, name)\n         parser.next()\n \n     print 'done'\n@@ -551,8 +553,11 @@ def parse_commit(parser):\n     ref = parser[1]\n     parser.next()\n \n-    if ref != 'refs/heads/master':\n-        die(\"bzr doesn't support multiple branches; use 'master'\")\n+    if ref.startswith('refs/heads/'):\n+        name = ref[len('refs/heads/'):]\n+        branch = branches[name]\n+    else:\n+        die('unknown ref')\n \n     commit_mark = parser.get_mark()\n     parser.next()\n@@ -588,8 +593,6 @@ def parse_commit(parser):\n         path = c_style_unescape(path).decode('utf-8')\n         files[path] = f\n \n-    branch = parser.repo\n-\n     committer, date, tz = committer\n     parents = [str(mark_to_rev(p)) for p in parents]\n     revid = bzrlib.generate_ids.gen_revision_id(committer, date)\n@@ -621,9 +624,6 @@ def parse_reset(parser):\n     ref = parser[1]\n     parser.next()\n \n-    if ref != 'refs/heads/master':\n-        die(\"bzr doesn't support multiple branches; use 'master'\")\n-\n     # ugh\n     if parser.check('commit'):\n         parse_commit(parser)\n@@ -636,7 +636,7 @@ def parse_reset(parser):\n     parsed_refs[ref] = mark_to_rev(from_mark)\n \n def do_export(parser):\n-    global parsed_refs, dirname, peer\n+    global parsed_refs, dirname\n \n     parser.next()\n \n@@ -654,23 +654,24 @@ def do_export(parser):\n         else:\n             die('unhandled export command: %s' % line)\n \n-    branch = parser.repo\n-\n     for ref, revid in parsed_refs.iteritems():\n-        if ref == 'refs/heads/master':\n-            branch.generate_revision_history(revid, marks.get_tip('master'))\n-            if peer:\n-                try:\n-                    branch.push(peer, stop_revision=revid)\n-                except bzrlib.errors.DivergedBranches:\n-                    print \"error %s non-fast forward\" % ref\n-                    continue\n+        name = ref[len('refs/heads/'):]\n+        branch = branches[name]\n+        branch.generate_revision_history(revid, marks.get_tip(name))\n \n+        if name in peers:\n+            peer = peers[name]\n             try:\n-                wt = branch.bzrdir.open_workingtree()\n-                wt.update()\n-            except bzrlib.errors.NoWorkingTree:\n-                pass\n+                peer.bzrdir.push_branch(branch, revision_id=revid)\n+            except bzrlib.errors.DivergedBranches:\n+                print \"error %s non-fast forward\" % ref\n+                continue\n+\n+        try:\n+            wt = branch.bzrdir.open_workingtree()\n+            wt.update()\n+        except bzrlib.errors.NoWorkingTree:\n+            pass\n \n         print \"ok %s\" % ref\n \n@@ -697,9 +698,15 @@ def ref_is_valid(name):\n \n def do_list(parser):\n     global tags\n-    print \"? refs/heads/%s\" % 'master'\n \n-    branch = parser.repo\n+    master_branch = None\n+\n+    for name in branches:\n+        if not master_branch:\n+            master_branch = name\n+        print \"? refs/heads/%s\" % name\n+\n+    branch = branches[master_branch]\n     branch.lock_read()\n     for tag, revid in branch.tags.get_tag_dict().items():\n         try:\n@@ -711,41 +718,77 @@ def do_list(parser):\n         print \"? refs/tags/%s\" % tag\n         tags[tag] = revid\n     branch.unlock()\n-    print \"@refs/heads/%s HEAD\" % 'master'\n+\n+    print \"@refs/heads/%s HEAD\" % master_branch\n     print\n \n+def get_remote_branch(origin, remote_branch, name):\n+    global dirname, peers\n+\n+    branch_path = os.path.join(dirname, 'clone', name)\n+    if os.path.exists(branch_path):\n+        # pull\n+        d = bzrlib.bzrdir.BzrDir.open(branch_path)\n+        branch = d.open_branch()\n+        try:\n+            branch.pull(remote_branch, [], None, False)\n+        except bzrlib.errors.DivergedBranches:\n+            # use remote branch for now\n+            return remote_branch\n+    else:\n+        # clone\n+        d = origin.sprout(branch_path, None,\n+                hardlink=True, create_tree_if_local=False,\n+                force_new_repo=False,\n+                source_branch=remote_branch)\n+        branch = d.open_branch()\n+\n+    return branch\n+\n def get_repo(url, alias):\n-    global dirname, peer\n+    global dirname, peer, branches\n \n+    normal_url = bzrlib.urlutils.normalize_url(url)\n     origin = bzrlib.bzrdir.BzrDir.open(url)\n-    branch = origin.open_branch()\n-\n-    if not isinstance(origin.transport, bzrlib.transport.local.LocalTransport):\n-        clone_path = os.path.join(dirname, 'clone')\n-        remote_branch = branch\n-        if os.path.exists(clone_path):\n-            # pull\n-            d = bzrlib.bzrdir.BzrDir.open(clone_path)\n-            branch = d.open_branch()\n-            try:\n-                result = branch.pull(remote_branch, [], None, False)\n-            except bzrlib.errors.DivergedBranches:\n-                # use remote branch for now\n-                peer = None\n-                return remote_branch\n+    is_local = isinstance(origin.transport, bzrlib.transport.local.LocalTransport)\n+\n+    clone_path = os.path.join(dirname, 'clone')\n+\n+    try:\n+        repo = origin.open_repository()\n+    except bzrlib.errors.NoRepositoryPresent:\n+        # branch\n+\n+        name = 'master'\n+        branch = origin.open_branch()\n+\n+        if not is_local:\n+            if not os.path.exists(clone_path):\n+                os.mkdir(clone_path)\n+            peers[name] = branch\n+            branches[name] = get_remote_branch(origin, branch, name)\n         else:\n-            # clone\n-            d = origin.sprout(clone_path, None,\n-                    hardlink=True, create_tree_if_local=False,\n-                    source_branch=remote_branch)\n-            branch = d.open_branch()\n-            branch.bind(remote_branch)\n-\n-        peer = remote_branch\n+            branches[name] = branch\n+\n+        return branch.repository\n     else:\n-        peer = None\n+        # repository\n \n-    return branch\n+        if not is_local and not os.path.exists(clone_path):\n+            clonedir = bzrlib.bzrdir.BzrDir.create(clone_path)\n+\n+        for branch in repo.find_branches():\n+\n+            name = repo.user_transport.relpath(branch.base)\n+            name = name if name != '' else 'master'\n+\n+            if not is_local:\n+                peers[name] = branch\n+                branches[name] = get_remote_branch(origin, branch, name)\n+            else:\n+                branches[name] = branch\n+\n+        return repo\n \n def fix_path(alias, orig_url):\n     url = urlparse.urlparse(orig_url, 'file')\n@@ -762,6 +805,7 @@ def main(args):\n     global parsed_refs\n     global files_cache\n     global is_tmp\n+    global branches, peers\n \n     alias = args[1]\n     url = args[2]\n@@ -772,6 +816,8 @@ def main(args):\n     parsed_refs = {}\n     files_cache = {}\n     marks = None\n+    branches = {}\n+    peers = {}\n \n     if alias[5:] == url:\n         is_tmp = True\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215553","messageId":"1366938488-25425-11-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 10/20] remote-bzr: fix branch names","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:58Z","receivedAt":"2013-04-26T01:07:58Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"When branches have '/' in their name (aka. sub-branches), bazaar seems\nto choke while creating the new directory.\n\nAlso, git cannot have both 'foo' and 'foo/bar'.\n\nSo let's replace slashes with a plus sign.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 3b33061..38cec07 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -781,6 +781,7 @@ def get_repo(url, alias):\n \n             name = repo.user_transport.relpath(branch.base)\n             name = name if name != '' else 'master'\n+            name = name.replace('/', '+')\n \n             if not is_local:\n                 peers[name] = branch\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215552","messageId":"1366938488-25425-12-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 11/20] remote-bzr: add support for shared repo","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:07:59Z","receivedAt":"2013-04-26T01:07:59Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"This way all the remotes share the same data, so adding multiple\nremotes, or renaming them doesn't create extra overhead.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 22 +++++++++++++++-------\n 1 file changed, 15 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 38cec07..9fe830e 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -752,7 +752,20 @@ def get_repo(url, alias):\n     origin = bzrlib.bzrdir.BzrDir.open(url)\n     is_local = isinstance(origin.transport, bzrlib.transport.local.LocalTransport)\n \n-    clone_path = os.path.join(dirname, 'clone')\n+    shared_path = os.path.join(gitdir, 'bzr')\n+    try:\n+        shared_dir = bzrlib.bzrdir.BzrDir.open(shared_path)\n+    except bzrlib.errors.NotBranchError:\n+        shared_dir = bzrlib.bzrdir.BzrDir.create(shared_path)\n+    try:\n+        shared_repo = shared_dir.open_repository()\n+    except bzrlib.errors.NoRepositoryPresent:\n+        shared_repo = shared_dir.create_repository(shared=True)\n+\n+    if not is_local:\n+        clone_path = os.path.join(dirname, 'clone')\n+        if not os.path.exists(clone_path):\n+            os.mkdir(clone_path)\n \n     try:\n         repo = origin.open_repository()\n@@ -763,8 +776,6 @@ def get_repo(url, alias):\n         branch = origin.open_branch()\n \n         if not is_local:\n-            if not os.path.exists(clone_path):\n-                os.mkdir(clone_path)\n             peers[name] = branch\n             branches[name] = get_remote_branch(origin, branch, name)\n         else:\n@@ -774,9 +785,6 @@ def get_repo(url, alias):\n     else:\n         # repository\n \n-        if not is_local and not os.path.exists(clone_path):\n-            clonedir = bzrlib.bzrdir.BzrDir.create(clone_path)\n-\n         for branch in repo.find_branches():\n \n             name = repo.user_transport.relpath(branch.base)\n@@ -800,7 +808,7 @@ def fix_path(alias, orig_url):\n     subprocess.call(cmd)\n \n def main(args):\n-    global marks, prefix, dirname\n+    global marks, prefix, gitdir, dirname\n     global tags, filenodes\n     global blob_marks\n     global parsed_refs\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215554","messageId":"1366938488-25425-13-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 12/20] remote-bzr: split marks file","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:08:00Z","receivedAt":"2013-04-26T01:08:00Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"This way all the remotes can share the same git objects, and the same\nmarks. The information we want to store per remote is very small.\n\nThe code transparently converts from one organization of marks, to the\nother. It's rather smooth and there shouldn't be any issues.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 58 ++++++++++++++++++++++++++---------\n 1 file changed, 43 insertions(+), 15 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 9fe830e..fcd8e41 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -52,22 +52,42 @@ def gittz(tz):\n \n class Marks:\n \n-    def __init__(self, path):\n-        self.path = path\n+    def __init__(self, gitdir, dirname):\n+        self.marks_path = os.path.join(gitdir, 'bzr', '.marks-bzr')\n+        self.remote_path = os.path.join(dirname, '.marks-bzr')\n+        old_path = os.path.join(dirname, 'marks-int')\n+\n         self.tips = {}\n         self.marks = {}\n         self.rev_marks = {}\n         self.last_mark = 0\n-        self.load()\n+\n+        if not os.path.exists(old_path):\n+            self.load()\n+        else:\n+            self.old_load(old_path)\n+            os.remove(old_path)\n \n     def load(self):\n-        if not os.path.exists(self.path):\n-            return\n \n-        tmp = json.load(open(self.path))\n+        if os.path.exists(self.marks_path):\n+            tmp = json.load(open(self.marks_path))\n+            self.marks = tmp['marks']\n+            self.last_mark = tmp['last-mark']\n+\n+            for rev, mark in self.marks.iteritems():\n+                self.rev_marks[mark] = rev\n+\n+        if os.path.exists(self.remote_path):\n+            tmp = json.load(open(self.remote_path))\n+            self.tips = tmp['tips']\n+\n+    def old_load(self, path):\n+\n+        tmp = json.load(open(path))\n         self.tips = tmp['tips']\n-        self.marks = tmp['marks']\n-        self.last_mark = tmp['last-mark']\n+        self.marks = tmp['marks'] # TODO remove\n+        self.last_mark = tmp['last-mark'] # TODO remove\n \n         for rev, mark in self.marks.iteritems():\n             self.rev_marks[mark] = rev\n@@ -76,7 +96,10 @@ class Marks:\n         return { 'tips': self.tips, 'marks': self.marks, 'last-mark' : self.last_mark }\n \n     def store(self):\n-        json.dump(self.dict(), open(self.path, 'w'))\n+        d = { 'marks': self.marks, 'last-mark' : self.last_mark }\n+        json.dump(d, open(self.marks_path, 'w'))\n+        d = { 'tips': self.tips }\n+        json.dump(d, open(self.remote_path, 'w'))\n \n     def __str__(self):\n         return str(self.dict())\n@@ -348,10 +371,10 @@ def export_tag(repo, name):\n     print\n \n def do_import(parser):\n-    global dirname\n+    global gitdir\n \n     repo = parser.repo\n-    path = os.path.join(dirname, 'marks-git')\n+    path = os.path.join(gitdir, 'bzr', '.marks-git')\n \n     print \"feature done\"\n     if os.path.exists(path):\n@@ -678,14 +701,14 @@ def do_export(parser):\n     print\n \n def do_capabilities(parser):\n-    global dirname\n+    global gitdir\n \n     print \"import\"\n     print \"export\"\n     print \"refspec refs/heads/*:%s/heads/*\" % prefix\n     print \"refspec refs/tags/*:%s/tags/*\" % prefix\n \n-    path = os.path.join(dirname, 'marks-git')\n+    path = os.path.join(gitdir, 'bzr', '.marks-git')\n \n     if os.path.exists(path):\n         print \"*import-marks %s\" % path\n@@ -848,8 +871,13 @@ def main(args):\n \n     repo = get_repo(url, alias)\n \n-    marks_path = os.path.join(dirname, 'marks-int')\n-    marks = Marks(marks_path)\n+    marks = Marks(gitdir, dirname)\n+\n+    # move old marks\n+    old_gitmarks = os.path.join(dirname, 'marks-git')\n+    new_gitmarks = os.path.join(gitdir, 'bzr', '.marks-git')\n+    if os.path.exists(old_gitmarks):\n+        os.rename(old_gitmarks, new_gitmarks)\n \n     parser = Parser(repo)\n     for line in parser:\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215555","messageId":"1366938488-25425-14-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 13/20] remote-bzr: improve author sanitazion","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:08:01Z","receivedAt":"2013-04-26T01:08:01Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"So that we don't end up with '<None>', and also synchronize it with the\none from remote-hg.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 15 +++++++++++++--\n 1 file changed, 13 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex fcd8e41..5c25b06 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -38,6 +38,7 @@ import atexit, shutil, hashlib, urlparse, subprocess\n \n NAME_RE = re.compile('^([^<>]+)')\n AUTHOR_RE = re.compile('^([^<>]+?)? ?<([^<>]*)>$')\n+EMAIL_RE = re.compile('^([^<>]+[^ \\\\\\t<>])?\\\\b(?:[ \\\\t<>]*?)\\\\b([^ \\\\t<>]+@[^ \\\\t<>]+)')\n RAW_AUTHOR_RE = re.compile('^(\\w+) (.+)? <(.*)> (\\d+) ([+-]\\d+)')\n \n def die(msg, *args):\n@@ -198,9 +199,19 @@ def fixup_user(user):\n         name = m.group(1)\n         mail = m.group(2).strip()\n     else:\n-        m = NAME_RE.match(user)\n+        m = EMAIL_RE.match(user)\n         if m:\n-            name = m.group(1).strip()\n+            name = m.group(1)\n+            mail = m.group(2)\n+        else:\n+            m = NAME_RE.match(user)\n+            if m:\n+                name = m.group(1).strip()\n+\n+    if not name:\n+        name = 'unknown'\n+    if not mail:\n+        mail = 'Unknown'\n \n     return '%s <%s>' % (name, mail)\n \n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215556","messageId":"1366938488-25425-15-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 14/20] remote-bzr: add custom method to find branches","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:08:02Z","receivedAt":"2013-04-26T01:08:02Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"The official method is incredibly inefficient and slow.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 25 ++++++++++++++++++++-----\n 1 file changed, 20 insertions(+), 5 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 5c25b06..5155b93 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -779,6 +779,25 @@ def get_remote_branch(origin, remote_branch, name):\n \n     return branch\n \n+def find_branches(repo):\n+    transport = repo.user_transport\n+\n+    for fn in transport.iter_files_recursive():\n+        if not fn.endswith('.bzr/branch-format'):\n+            continue\n+\n+        name = subdir = fn[:-len('/.bzr/branch-format')]\n+        name = name if name != '' else 'master'\n+        name = name.replace('/', '+')\n+\n+        try:\n+            cur = transport.clone(subdir)\n+            branch = bzrlib.branch.Branch.open_from_transport(cur)\n+        except bzrlib.errors.NotBranchError:\n+            continue\n+        else:\n+            yield name, branch\n+\n def get_repo(url, alias):\n     global dirname, peer, branches\n \n@@ -819,11 +838,7 @@ def get_repo(url, alias):\n     else:\n         # repository\n \n-        for branch in repo.find_branches():\n-\n-            name = repo.user_transport.relpath(branch.base)\n-            name = name if name != '' else 'master'\n-            name = name.replace('/', '+')\n+        for name, branch in find_branches(repo):\n \n             if not is_local:\n                 peers[name] = branch\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215562","messageId":"1366938488-25425-16-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 15/20] remote-bzr: add option to specify branches","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:08:03Z","receivedAt":"2013-04-26T01:08:03Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We might not want all the branches. And branch handling in bazaar is\nrather tricky, so it's safer to simply specify them.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 20 ++++++++++++++++++--\n 1 file changed, 18 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 5155b93..06d9d24 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -13,6 +13,9 @@\n # or\n # % git clone bzr::lp:myrepo\n #\n+# If you want to specify which branches you want track (per repo):\n+# git config remote-bzr.branches 'trunk, devel, test'\n+#\n \n import sys\n \n@@ -51,6 +54,12 @@ def warn(msg, *args):\n def gittz(tz):\n     return '%+03d%02d' % (tz / 3600, tz % 3600 / 60)\n \n+def get_config(config):\n+    cmd = ['git', 'config', '--get', config]\n+    process = subprocess.Popen(cmd, stdout=subprocess.PIPE)\n+    output, _ = process.communicate()\n+    return output\n+\n class Marks:\n \n     def __init__(self, gitdir, dirname):\n@@ -779,7 +788,7 @@ def get_remote_branch(origin, remote_branch, name):\n \n     return branch\n \n-def find_branches(repo):\n+def find_branches(repo, wanted):\n     transport = repo.user_transport\n \n     for fn in transport.iter_files_recursive():\n@@ -790,6 +799,9 @@ def find_branches(repo):\n         name = name if name != '' else 'master'\n         name = name.replace('/', '+')\n \n+        if wanted and not name in wanted:\n+            continue\n+\n         try:\n             cur = transport.clone(subdir)\n             branch = bzrlib.branch.Branch.open_from_transport(cur)\n@@ -838,7 +850,11 @@ def get_repo(url, alias):\n     else:\n         # repository\n \n-        for name, branch in find_branches(repo):\n+        wanted = get_config('remote-bzr.branches').rstrip().split(', ')\n+        # stupid python\n+        wanted = [e for e in wanted if e]\n+\n+        for name, branch in find_branches(repo, wanted):\n \n             if not is_local:\n                 peers[name] = branch\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215557","messageId":"1366938488-25425-17-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 16/20] remote-bzr: improve progress reporting","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:08:04Z","receivedAt":"2013-04-26T01:08:04Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"No need to manually count the revisions, and also, this would help to\niterate more properly.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 20 +++++++++++++-------\n 1 file changed, 13 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 06d9d24..7d3052a 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -305,13 +305,16 @@ def export_branch(repo, name):\n \n     branch.lock_read()\n     revs = branch.iter_merge_sorted_revisions(None, tip, 'exclude', 'forward')\n-    count = 0\n+    tip_revno = branch.revision_id_to_revno(tip)\n+    last_revno, _ = branch.last_revision_info()\n+    total = last_revno - tip_revno\n \n-    revs = [revid for revid, _, _, _ in revs if not marks.is_marked(revid)]\n+    revs = [revid, seq for revid, _, seq, _ in revs if not marks.is_marked(revid)]\n \n-    for revid in revs:\n+    for revid, seq in revs:\n \n         rev = repo.get_revision(revid)\n+        revno = seq[0]\n \n         parents = rev.parent_ids\n         time = rev.timestamp\n@@ -366,10 +369,13 @@ def export_branch(repo, name):\n             print \"M %s :%u %s\" % f\n         print\n \n-        count += 1\n-        if (count % 100 == 0):\n-            print \"progress revision %s '%s' (%d/%d)\" % (revid, name, count, len(revs))\n-            print \"#############################################################\"\n+        if len(seq) > 1:\n+            # let's skip branch revisions from the progress report\n+            continue\n+\n+        progress = (revno - tip_revno)\n+        if (progress % 100 == 0):\n+            print \"progress revision %d '%s' (%d/%d)\" % (revno, name, progress, total)\n \n     branch.unlock()\n \n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215558","messageId":"1366938488-25425-18-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 17/20] remote-bzr: iterate revisions properly","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:08:05Z","receivedAt":"2013-04-26T01:08:05Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"This way we don't need to store the list of all the revisions, which\ndoesn't seem to be very memory efficient with bazaar's design, for\nwhatever reason.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 7d3052a..5f1b9c0 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -309,9 +309,10 @@ def export_branch(repo, name):\n     last_revno, _ = branch.last_revision_info()\n     total = last_revno - tip_revno\n \n-    revs = [revid, seq for revid, _, seq, _ in revs if not marks.is_marked(revid)]\n+    for revid, _, seq, _ in revs:\n \n-    for revid, seq in revs:\n+        if marks.is_marked(revid):\n+            continue\n \n         rev = repo.get_revision(revid)\n         revno = seq[0]\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215559","messageId":"1366938488-25425-19-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 18/20] remote-bzr: delay peer branch usage","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:08:06Z","receivedAt":"2013-04-26T01:08:06Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"So it doesn't time out.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 5f1b9c0..7517645 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -710,7 +710,7 @@ def do_export(parser):\n         branch.generate_revision_history(revid, marks.get_tip(name))\n \n         if name in peers:\n-            peer = peers[name]\n+            peer = bzrlib.branch.Branch.open(peers[name])\n             try:\n                 peer.bzrdir.push_branch(branch, revision_id=revid)\n             except bzrlib.errors.DivergedBranches:\n@@ -848,7 +848,7 @@ def get_repo(url, alias):\n         branch = origin.open_branch()\n \n         if not is_local:\n-            peers[name] = branch\n+            peers[name] = branch.base\n             branches[name] = get_remote_branch(origin, branch, name)\n         else:\n             branches[name] = branch\n@@ -864,7 +864,7 @@ def get_repo(url, alias):\n         for name, branch in find_branches(repo, wanted):\n \n             if not is_local:\n-                peers[name] = branch\n+                peers[name] = branch.base\n                 branches[name] = get_remote_branch(origin, branch, name)\n             else:\n                 branches[name] = branch\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215560","messageId":"1366938488-25425-20-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 19/20] remote-bzr: access branches only when needed","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:08:07Z","receivedAt":"2013-04-26T01:08:07Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Bazaar doesn't seem to be tested for multiple usage of branches, so\nresources seem to be leaked all over. Let's try to minimize this by\naccessing the Branch objects only when needed.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 28 ++++++++++++++++------------\n 1 file changed, 16 insertions(+), 12 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 7517645..3c59a18 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -300,7 +300,7 @@ def export_branch(repo, name):\n     ref = '%s/heads/%s' % (prefix, name)\n     tip = marks.get_tip(name)\n \n-    branch = branches[name]\n+    branch = bzrlib.branch.Branch.open(branches[name])\n     repo = branch.repository\n \n     branch.lock_read()\n@@ -605,7 +605,7 @@ def parse_commit(parser):\n \n     if ref.startswith('refs/heads/'):\n         name = ref[len('refs/heads/'):]\n-        branch = branches[name]\n+        branch = bzrlib.branch.Branch.open(branches[name])\n     else:\n         die('unknown ref')\n \n@@ -706,7 +706,7 @@ def do_export(parser):\n \n     for ref, revid in parsed_refs.iteritems():\n         name = ref[len('refs/heads/'):]\n-        branch = branches[name]\n+        branch = bzrlib.branch.Branch.open(branches[name])\n         branch.generate_revision_history(revid, marks.get_tip(name))\n \n         if name in peers:\n@@ -756,7 +756,7 @@ def do_list(parser):\n             master_branch = name\n         print \"? refs/heads/%s\" % name\n \n-    branch = branches[master_branch]\n+    branch = bzrlib.branch.Branch.open(branches[master_branch])\n     branch.lock_read()\n     for tag, revid in branch.tags.get_tag_dict().items():\n         try:\n@@ -845,13 +845,15 @@ def get_repo(url, alias):\n         # branch\n \n         name = 'master'\n-        branch = origin.open_branch()\n+        remote_branch = origin.open_branch()\n \n         if not is_local:\n-            peers[name] = branch.base\n-            branches[name] = get_remote_branch(origin, branch, name)\n+            peers[name] = remote_branch.base\n+            branch = get_remote_branch(origin, remote_branch, name)\n         else:\n-            branches[name] = branch\n+            branch = remote_branch\n+\n+        branches[name] = branch.base\n \n         return branch.repository\n     else:\n@@ -861,13 +863,15 @@ def get_repo(url, alias):\n         # stupid python\n         wanted = [e for e in wanted if e]\n \n-        for name, branch in find_branches(repo, wanted):\n+        for name, remote_branch in find_branches(repo, wanted):\n \n             if not is_local:\n-                peers[name] = branch.base\n-                branches[name] = get_remote_branch(origin, branch, name)\n+                peers[name] = remote_branch.base\n+                branch = get_remote_branch(origin, remote_branch, name)\n             else:\n-                branches[name] = branch\n+                branch = remote_branch\n+\n+            branches[name] = branch.base\n \n         return repo\n \n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215561","messageId":"1366938488-25425-21-git-send-email-felipe.contreras@gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 20/20] remote-bzr: export HEAD","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T01:08:08Z","receivedAt":"2013-04-26T01:08:08Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"It probably doesn't make any difference, since we usually fetch along\nthe 'master' branch, and when we don't probably the current\ntransport-helper code doesn't work correctly.\n\nBut if it did work correctly, this might be useful.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-bzr | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr\nindex 3c59a18..41c26a7 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -412,6 +412,8 @@ def do_import(parser):\n \n     while parser.check('import'):\n         ref = parser[1]\n+        if ref == 'HEAD':\n+            export_branch(repo, 'master')\n         if ref.startswith('refs/heads/'):\n             name = ref[len('refs/heads/'):]\n             export_branch(repo, name)\n-- \n1.8.2.1.884.g3532a8d\n"},{"id":"215565","messageId":"CAMP44s0XHXbX5brcxv-NROJ=PSSzi3oEzQv81=f3-1-zcypQuQ@mail.gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 00/20] remote-bzr: massive changes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T02:35:16Z","receivedAt":"2013-04-26T02:35:16Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, Apr 25, 2013 at 8:07 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n\nI forgot to mention; these apply on top of the previous 'fixes and cleanups'.\n\n> Felipe Contreras (20):\n>   remote-bzr: cleanup CustomTree\n>   remote-bzr: delay blob fetching until the very end\n>   remote-bzr: fix order of locking in CustomTree\n>   remote-bzr: always try to update the worktree\n>   remote-bzr: add support to push merges\n>   remote-bzr: fixes for branch diverge\n>   remote-bzr: fix partially pushed merge\n>   remote-bzr: use branch variable when appropriate\n>   remote-bzr: add support for bzr repos\n>   remote-bzr: fix branch names\n>   remote-bzr: add support for shared repo\n>   remote-bzr: split marks file\n>   remote-bzr: improve author sanitazion\n>   remote-bzr: add custom method to find branches\n>   remote-bzr: add option to specify branches\n>   remote-bzr: improve progress reporting\n>   remote-bzr: iterate revisions properly\n>   remote-bzr: delay peer branch usage\n>   remote-bzr: access branches only when needed\n>   remote-bzr: export HEAD\n>\n>  contrib/remote-helpers/git-remote-bzr | 365 +++++++++++++++++++++++++---------\n>  contrib/remote-helpers/test-bzr.sh    |  36 ++++\n>  2 files changed, 302 insertions(+), 99 deletions(-)\n\n-- \nFelipe Contreras\n"},{"id":"215599","messageId":"7vy5c5xmka.fsf@alter.siamese.dyndns.org","threadId":"33612","inReplyTo":"CAMP44s0XHXbX5brcxv-NROJ=PSSzi3oEzQv81=f3-1-zcypQuQ@mail.gmail.com","subject":"Re: [PATCH 00/20] remote-bzr: massive changes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-26T16:51:17Z","receivedAt":"2013-04-26T16:51:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Thu, Apr 25, 2013 at 8:07 PM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n>\n> I forgot to mention; these apply on top of the previous 'fixes and cleanups'.\n\nThen I should probably wait for v2 6/9 of that series is rerolled.\n\nThere could be ones that you may want to reroll other than 6/9 in\nthat, I didn't have time to look at the backlog. I'll be whipping\nthe -rc0 into shape today and it is unlikely I'll have time to look\nat this or the previous one today.\n\nThanks.\n"},{"id":"215650","messageId":"CAMP44s1ZCD4qNH23Zv-Lb3aq9qGeB0LAkr8mOBwusMKPO9GVmg@mail.gmail.com","threadId":"33612","inReplyTo":"7vy5c5xmka.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 00/20] remote-bzr: massive changes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T21:21:37Z","receivedAt":"2013-04-26T21:21:37Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Fri, Apr 26, 2013 at 11:51 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> On Thu, Apr 25, 2013 at 8:07 PM, Felipe Contreras\n>> <felipe.contreras@gmail.com> wrote:\n>>\n>> I forgot to mention; these apply on top of the previous 'fixes and cleanups'.\n>\n> Then I should probably wait for v2 6/9 of that series is rerolled.\n\nDone.\n\n> There could be ones that you may want to reroll other than 6/9 in\n> that, I didn't have time to look at the backlog. I'll be whipping\n> the -rc0 into shape today and it is unlikely I'll have time to look\n> at this or the previous one today.\n\nI don't see any need to reroll more. All the concerns of v1 and v2\nhave been addressed in one way or the other.\n\n-- \nFelipe Contreras\n"},{"id":"215665","messageId":"CAMP44s2dzV428+_ZENg_Z5n=rnvqz1ZNAxnjsqCtLSJK-9PZZg@mail.gmail.com","threadId":"33612","inReplyTo":"1366938488-25425-13-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 12/20] remote-bzr: split marks file","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-26T23:36:19Z","receivedAt":"2013-04-26T23:36:19Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, Apr 25, 2013 at 8:08 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n> This way all the remotes can share the same git objects, and the same\n> marks. The information we want to store per remote is very small.\n>\n> The code transparently converts from one organization of marks, to the\n> other. It's rather smooth and there shouldn't be any issues.\n\nPlease drop this patch. While testing essentially the same\nfunctionality in remote-hg I noticed that it doesn't work when dealing\nwith more than one remote. It's not clear if the marks can be shared\nat all, and if possible, it would be very tricky.\n\nBetter drop it for now. I've tested that dropping this patch doesn't\ncause an conflicts for the rest of the series.\n\nAnd in case anybody is thinking that remote-bzr is really a too fast\nmoving target; even if this managed to land in 'master', it's likely\nthat people were not able to push at all, and in fact, many were not\neven able to clone in 1.8.2. So, hardly could be considered a\nregression. Nevertheless, I caught it in time.\n\nCheers.\n\n-- \nFelipe Contreras\n"},{"id":"215666","messageId":"7v4nesvncw.fsf@alter.siamese.dyndns.org","threadId":"33612","inReplyTo":"CAMP44s2dzV428+_ZENg_Z5n=rnvqz1ZNAxnjsqCtLSJK-9PZZg@mail.gmail.com","subject":"Re: [PATCH 12/20] remote-bzr: split marks file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-27T00:17:03Z","receivedAt":"2013-04-27T00:17:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> And in case anybody is thinking that remote-bzr is really a too fast\n> moving target; even if this managed to land in 'master', it's likely\n> that people were not able to push at all, and in fact, many were not\n> even able to clone in 1.8.2. So, hardly could be considered a\n> regression. Nevertheless, I caught it in time.\n\nYou didn't.  I am already way too deep into today's 1.8.3-rc0\nintegration cycle and I won't waste a couple of hours work just to\nrevert this.\n\nBut from your description it sounds like with or without the patch\nthe helper is equally broken and it does not make that much of a\ndifference.\n"},{"id":"215670","messageId":"CAMP44s3jw-uy_BJyWjkGEPPeEiD4A8M3ywAAbmWRn44vfvDTvQ@mail.gmail.com","threadId":"33612","inReplyTo":"7v4nesvncw.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 12/20] remote-bzr: split marks file","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-27T00:35:29Z","receivedAt":"2013-04-27T00:35:29Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Fri, Apr 26, 2013 at 7:17 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> And in case anybody is thinking that remote-bzr is really a too fast\n>> moving target; even if this managed to land in 'master', it's likely\n>> that people were not able to push at all, and in fact, many were not\n>> even able to clone in 1.8.2. So, hardly could be considered a\n>> regression. Nevertheless, I caught it in time.\n>\n> You didn't.  I am already way too deep into today's 1.8.3-rc0\n> integration cycle and I won't waste a couple of hours work just to\n> revert this.\n\nAll right, if you already merged this patch series, you could do what\nI did in my public branch: revert it, it's a single command, doesn't\ntake hours.\n\nBut I don't see this series in origin/master, am I missing something?\n\n> But from your description it sounds like with or without the patch\n> the helper is equally broken and it does not make that much of a\n> difference.\n\nIndeed. Many people would need this patch series to push, and this\npatch breaks the push for more than one remote. So if you merged the\nwhole thing quite likely their situation would improve; they could at\nleast push to one remote, instead of zero. Of course, if you remove\nthis patch, they would be able to push to many.\n\nBut I don't see it merged.\n\nCheers.\n\n-- \nFelipe Contreras\n"},{"id":"215796","messageId":"7v1u9usdag.fsf@alter.siamese.dyndns.org","threadId":"33612","inReplyTo":"7v4nesvncw.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 12/20] remote-bzr: split marks file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-28T18:47:19Z","receivedAt":"2013-04-28T18:47:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> And in case anybody is thinking that remote-bzr is really a too fast\n>> moving target; even if this managed to land in 'master', it's likely\n>> that people were not able to push at all, and in fact, many were not\n>> even able to clone in 1.8.2. So, hardly could be considered a\n>> regression. Nevertheless, I caught it in time.\n>\n> You didn't.  I am already way too deep into today's 1.8.3-rc0\n> integration cycle and I won't waste a couple of hours work just to\n> revert this.\n\nOh, I was lucky ;-) I mistook this with the other 9-patch bzr\nclean-up series that I applied to 'master' for -rc0.\n\nPushing out a tagged-tip takes a lot longer than the normal tip\nbecause a lot more than what people see have to happen on my end.\n\nReverting a single patch is simple, but we do not want to do that on\ntop of \"Git 1.8.3-rc0\" commit and move the unpublished tag to point\nat the revert.\n\nWhich means pretty much everything needs to be redone (one example\namong many is that the tagname will propagate to the htmldocs and\nmanpages repositories, so their unpublished histories need to be\nrewound).\n\nBut I didn't have to do that in the end ;-)\n"},{"id":"215820","messageId":"CAMP44s22AJ574nzXiXyMxV3SUiv8xz5yokS6__4Ck6oK4DwcGg@mail.gmail.com","threadId":"33612","inReplyTo":"7v1u9usdag.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 12/20] remote-bzr: split marks file","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-29T04:57:21Z","receivedAt":"2013-04-29T04:57:21Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Apr 28, 2013 at 1:47 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>>\n>>> And in case anybody is thinking that remote-bzr is really a too fast\n>>> moving target; even if this managed to land in 'master', it's likely\n>>> that people were not able to push at all, and in fact, many were not\n>>> even able to clone in 1.8.2. So, hardly could be considered a\n>>> regression. Nevertheless, I caught it in time.\n>>\n>> You didn't.  I am already way too deep into today's 1.8.3-rc0\n>> integration cycle and I won't waste a couple of hours work just to\n>> revert this.\n>\n> Oh, I was lucky ;-) I mistook this with the other 9-patch bzr\n> clean-up series that I applied to 'master' for -rc0.\n>\n> Pushing out a tagged-tip takes a lot longer than the normal tip\n> because a lot more than what people see have to happen on my end.\n>\n> Reverting a single patch is simple, but we do not want to do that on\n> top of \"Git 1.8.3-rc0\" commit and move the unpublished tag to point\n> at the revert.\n>\n> Which means pretty much everything needs to be redone (one example\n> among many is that the tagname will propagate to the htmldocs and\n> manpages repositories, so their unpublished histories need to be\n> rewound).\n>\n> But I didn't have to do that in the end ;-)\n\nYeah, I realized you were talking about that one later on. I haven't\nheard anything bad from this new branch from emacs developers, so I\nthink it's OK to merge it.\n\nCheers.\n\n-- \nFelipe Contreras\n"}]}