{"thread":{"id":"33689","subject":"[PATCH v2 00/18] remote-bzr: massive changes","startedAt":"2013-05-01T01:09:52Z","lastAt":"2014-01-03T20:17:14Z","messageCount":25,"participants":["Felipe Contreras","Junio C Hamano","Ted Zlatanov"],"isPatch":true,"patchVersion":2,"patchTotal":18},"messages":[{"id":"216097","messageId":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":null,"subject":"[PATCH v2 00/18] remote-bzr: massive changes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:09:52Z","receivedAt":"2013-05-01T01:09:52Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nThis is the same as last series, except that I dropped a couple of conflicting\npatches, and added one test.\n\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\nFelipe Contreras (18):\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: 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\n contrib/remote-helpers/git-remote-bzr | 305 ++++++++++++++++++++++++----------\n contrib/remote-helpers/test-bzr.sh    |  72 ++++++++\n 2 files changed, 293 insertions(+), 84 deletions(-)\n\n-- \n1.8.3.rc0.399.gc96a135\n"},{"id":"216098","messageId":"1367370610-14250-2-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 01/18] remote-bzr: cleanup CustomTree","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:09:53Z","receivedAt":"2013-05-01T01:09:53Z","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.3.rc0.399.gc96a135\n"},{"id":"216101","messageId":"1367370610-14250-3-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 02/18] remote-bzr: delay blob fetching until the very end","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:09:54Z","receivedAt":"2013-05-01T01:09:54Z","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.3.rc0.399.gc96a135\n"},{"id":"216099","messageId":"1367370610-14250-4-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 03/18] remote-bzr: fix order of locking in CustomTree","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:09:55Z","receivedAt":"2013-05-01T01:09:55Z","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.3.rc0.399.gc96a135\n"},{"id":"216100","messageId":"1367370610-14250-5-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 04/18] remote-bzr: always try to update the worktree","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:09:56Z","receivedAt":"2013-05-01T01:09:56Z","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.3.rc0.399.gc96a135\n"},{"id":"216102","messageId":"1367370610-14250-6-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 05/18] remote-bzr: add support to push merges","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:09:57Z","receivedAt":"2013-05-01T01:09:57Z","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.3.rc0.399.gc96a135\n"},{"id":"216103","messageId":"1367370610-14250-7-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 06/18] remote-bzr: fixes for branch diverge","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:09:58Z","receivedAt":"2013-05-01T01:09:58Z","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.3.rc0.399.gc96a135\n"},{"id":"216104","messageId":"1367370610-14250-8-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 07/18] remote-bzr: fix partially pushed merge","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:09:59Z","receivedAt":"2013-05-01T01:09:59Z","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.3.rc0.399.gc96a135\n"},{"id":"216105","messageId":"1367370610-14250-9-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 08/18] remote-bzr: use branch variable when appropriate","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:10:00Z","receivedAt":"2013-05-01T01:10:00Z","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.3.rc0.399.gc96a135\n"},{"id":"216106","messageId":"1367370610-14250-10-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 09/18] remote-bzr: add support for bzr repos","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:10:01Z","receivedAt":"2013-05-01T01:10:01Z","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 contrib/remote-helpers/test-bzr.sh    |  36 ++++++++\n 2 files changed, 138 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\ndiff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh\nindex eca3476..cec55f1 100755\n--- a/contrib/remote-helpers/test-bzr.sh\n+++ b/contrib/remote-helpers/test-bzr.sh\n@@ -264,4 +264,40 @@ test_expect_success 'pushing a merge' '\n   test_cmp expected actual\n '\n \n+cat > expected <<EOF\n+origin/HEAD\n+origin/branch\n+origin/trunk\n+EOF\n+\n+test_expect_success 'proper bzr repo' '\n+  mkdir -p tmp && cd tmp &&\n+  test_when_finished \"cd .. && rm -rf tmp\" &&\n+\n+  bzr init-repo bzrrepo &&\n+\n+  bzr init bzrrepo/trunk &&\n+  (\n+  cd bzrrepo/trunk &&\n+  echo one >> content &&\n+  bzr add content &&\n+  bzr commit -m one\n+  ) &&\n+\n+  bzr branch bzrrepo/trunk bzrrepo/branch &&\n+  (\n+  cd bzrrepo/branch &&\n+  echo two >> content &&\n+  bzr commit -m one\n+  ) &&\n+\n+  git clone \"bzr::$PWD/bzrrepo\" gitrepo &&\n+  (\n+  cd gitrepo &&\n+  git for-each-ref --format \"%(refname:short)\" refs/remotes/origin > ../actual\n+  ) &&\n+\n+  test_cmp ../expected actual\n+'\n+\n test_done\n-- \n1.8.3.rc0.399.gc96a135\n"},{"id":"216107","messageId":"1367370610-14250-11-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 10/18] remote-bzr: fix branch names","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:10:02Z","receivedAt":"2013-05-01T01:10:02Z","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.3.rc0.399.gc96a135\n"},{"id":"216108","messageId":"1367370610-14250-12-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 11/18] remote-bzr: add support for shared repo","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:10:03Z","receivedAt":"2013-05-01T01:10:03Z","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.3.rc0.399.gc96a135\n"},{"id":"216111","messageId":"1367370610-14250-13-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 12/18] remote-bzr: improve author sanitazion","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:10:04Z","receivedAt":"2013-05-01T01:10:04Z","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 9fe830e..af46016 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@@ -175,9 +176,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.3.rc0.399.gc96a135\n"},{"id":"216109","messageId":"1367370610-14250-14-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 13/18] remote-bzr: add custom method to find branches","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:10:05Z","receivedAt":"2013-05-01T01:10:05Z","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 af46016..11f2415 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -756,6 +756,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@@ -796,11 +815,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.3.rc0.399.gc96a135\n"},{"id":"216110","messageId":"1367370610-14250-15-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 14/18] remote-bzr: add option to specify branches","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:10:06Z","receivedAt":"2013-05-01T01:10:06Z","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 11f2415..d284afc 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, path):\n@@ -756,7 +765,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@@ -767,6 +776,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@@ -815,7 +827,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.3.rc0.399.gc96a135\n"},{"id":"216112","messageId":"1367370610-14250-16-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 15/18] remote-bzr: improve progress reporting","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:10:07Z","receivedAt":"2013-05-01T01:10:07Z","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 d284afc..2e21008 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -282,13 +282,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@@ -343,10 +346,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.3.rc0.399.gc96a135\n"},{"id":"216113","messageId":"1367370610-14250-17-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 16/18] remote-bzr: iterate revisions properly","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:10:08Z","receivedAt":"2013-05-01T01:10:08Z","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 2e21008..66e3861 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -286,9 +286,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.3.rc0.399.gc96a135\n"},{"id":"216115","messageId":"1367370610-14250-18-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 17/18] remote-bzr: delay peer branch usage","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:10:09Z","receivedAt":"2013-05-01T01:10:09Z","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 66e3861..b2d67f7 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -687,7 +687,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@@ -825,7 +825,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@@ -841,7 +841,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.3.rc0.399.gc96a135\n"},{"id":"216114","messageId":"1367370610-14250-19-git-send-email-felipe.contreras@gmail.com","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 18/18] remote-bzr: access branches only when needed","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T01:10:10Z","receivedAt":"2013-05-01T01:10:10Z","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 b2d67f7..161f831 100755\n--- a/contrib/remote-helpers/git-remote-bzr\n+++ b/contrib/remote-helpers/git-remote-bzr\n@@ -277,7 +277,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@@ -582,7 +582,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@@ -683,7 +683,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@@ -733,7 +733,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@@ -822,13 +822,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@@ -838,13 +840,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.3.rc0.399.gc96a135\n"},{"id":"216123","messageId":"7vppxb8d9k.fsf@alter.siamese.dyndns.org","threadId":"33689","inReplyTo":"1367370610-14250-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v2 00/18] remote-bzr: massive changes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-01T05:44:55Z","receivedAt":"2013-05-01T05:44:55Z","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> After being contacted by the emacs developers and others who are stuck with\n> Bazaar, which at this point seems to be utterly abandoned, I realized the\n> current implementation is too crude.\n> ...\n> That is of course, if pushing actually worked (which in many cases doesn't).\n>\n> In short, our support for real-world projects suck.\n>\n> These patches fix all the issues I encountrered.\n> ...\n> Finally, after all these changes I was finally able to clone the whole emacs\n> repository, all 130685 commits, and 56 branches without running out of memory\n> in my modest laptop.\n\nYay ;-)\n\nI assume that the trees at a handful of key points (e.g. releases)\nwere verified to be identical with the original history and the\nconversion result.\n\n> Since the purpose of remote-bzr is to actually be usable for the\n> poor souls stucks in DSCMs that are not git, these changes are a\n> must. I propose they be merged for the next major version of git\n> (v1.8.3) if no issues are found.  They changes pass all the tests,\n> and work on various repositories I've tried.\n\nNice.\n\n> I'll ask the emacs developers to give them a try, and let's see\n> how it goes.\n\nYeah, that's the least we can do for both existing and future users.\n\nGenerally speaking, post -rc0 is too late for \"if no issues are\nfound\", simply because no existing user has enough time to find\ncorner case regressions in her work using the new software (I do\nnot expect a trivial bug that can be uncovered in a few weeks of use\nwould remain in a version that has successfully converted the Emacs\nhistory; but real world users always have different needs than what\nwe anticipate).\n\nI however am finding myself moderately receptive to this series.\nThat is primarily because this series touches only two files that\nare totally isolated from the rest of the system.  Even if they did\nnot work at all, there is no risk for the remainder of Git.  Nobody\nother than existing users of remote-bzr will even notice if we\nmerged this by the final.\n\nFor existing users of remote-bzr that we shipped in 1.8.2, the story\nis a bit different, though.  If this series makes things worse in a\nway your tests did not reveal, and if such a regression is not\nreported and/or cannot be fixed by 1.8.3 final, that will mean a\nreal regression in the released version for them.\n\nIf that ever happens, that would be the time for us to regret the\nhasty decision to merge remote-bzr in 1.8.2, justifying that with a\n\"There wasn't anything working for interoperating with bzr, and here\nis one to do so; anything is better than nothing\", and learn from\nthat mistake (it is not an option to say \"the 1.8.2 users chose to\nuse contrib/ material that are clearly marked as sub-par quality\nwith their own risk\".  If we did not ship it in 1.8.2, they did not\nhave to get burned with any regression and could have kept working\nwith bzr a bit longer.  \"Anything\" is not necessarily better than\n\"nothing\").\n\nHopefully, such a regression will not have to happen (for one thing,\nI would expect that the existing 1.8.2 remote-bzr user base would be\nvery small).  Also I somehow have a feeling that it is very unlikely\nto happen, especially given your report:\n\n (1) the series converts Emacs history without barfing; and\n\n (2) you have some confidence in the conversion result after\n     inspecting at least a handful of key release points and trees\n     and metainformation match between the original and the\n     converted history.\n\nSo let's go ahead and apply these directly on top of 'master', once\nwe hear from Emacs folks and they are happy with it.  I'll queue it\non 'pu' so that I do not have to go back to the list archive when it\nhappens.\n\nThanks.\n"},{"id":"216124","messageId":"CAMP44s3zf0Hbx4-KHVH7+wCm_czTigJo2y=wqD5Ai-9cKxZcug@mail.gmail.com","threadId":"33689","inReplyTo":"7vppxb8d9k.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2 00/18] remote-bzr: massive changes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T06:36:02Z","receivedAt":"2013-05-01T06:36:02Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, May 1, 2013 at 12:44 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> After being contacted by the emacs developers and others who are stuck with\n>> Bazaar, which at this point seems to be utterly abandoned, I realized the\n>> current implementation is too crude.\n>> ...\n>> That is of course, if pushing actually worked (which in many cases doesn't).\n>>\n>> In short, our support for real-world projects suck.\n>>\n>> These patches fix all the issues I encountrered.\n>> ...\n>> Finally, after all these changes I was finally able to clone the whole emacs\n>> repository, all 130685 commits, and 56 branches without running out of memory\n>> in my modest laptop.\n>\n> Yay ;-)\n>\n> I assume that the trees at a handful of key points (e.g. releases)\n> were verified to be identical with the original history and the\n> conversion result.\n\nNot really. I don't think the users are that interested in the history\nbeing identical at this point, merely that they can use it as a proxy\nto interact with bazaar repositories.\n\nPeople have found discrepancies, so I assume they have compared at\nleast the tip of the branches, and found them. This probably means\nthat the history is correct, since bazaar deals with changesets (git\nis one of the few DSCMs that don't).\n\nAlso, there's further news on this, pushes seem to work correctly to\nthe emacs' repo[1].\n\n>> I'll ask the emacs developers to give them a try, and let's see\n>> how it goes.\n>\n> Yeah, that's the least we can do for both existing and future users.\n>\n> Generally speaking, post -rc0 is too late for \"if no issues are\n> found\", simply because no existing user has enough time to find\n> corner case regressions in her work using the new software (I do\n> not expect a trivial bug that can be uncovered in a few weeks of use\n> would remain in a version that has successfully converted the Emacs\n> history; but real world users always have different needs than what\n> we anticipate).\n>\n> I however am finding myself moderately receptive to this series.\n> That is primarily because this series touches only two files that\n> are totally isolated from the rest of the system.  Even if they did\n> not work at all, there is no risk for the remainder of Git.  Nobody\n> other than existing users of remote-bzr will even notice if we\n> merged this by the final.\n>\n> For existing users of remote-bzr that we shipped in 1.8.2, the story\n> is a bit different, though.  If this series makes things worse in a\n> way your tests did not reveal, and if such a regression is not\n> reported and/or cannot be fixed by 1.8.3 final, that will mean a\n> real regression in the released version for them.\n>\n> If that ever happens, that would be the time for us to regret the\n> hasty decision to merge remote-bzr in 1.8.2, justifying that with a\n> \"There wasn't anything working for interoperating with bzr, and here\n> is one to do so; anything is better than nothing\", and learn from\n> that mistake (it is not an option to say \"the 1.8.2 users chose to\n> use contrib/ material that are clearly marked as sub-par quality\n> with their own risk\".  If we did not ship it in 1.8.2, they did not\n> have to get burned with any regression and could have kept working\n> with bzr a bit longer.  \"Anything\" is not necessarily better than\n> \"nothing\").\n\nFortunately there seem to be at least some users that find what is in\n1.8.2 working to some extent, not in all the repositories, and not all\nthe features, but at least something, which is much better than the\nalternatives, even the best one has been blocked for years, even when\na solution is known[2].\n\n> Hopefully, such a regression will not have to happen (for one thing,\n> I would expect that the existing 1.8.2 remote-bzr user base would be\n> very small).  Also I somehow have a feeling that it is very unlikely\n> to happen, especially given your report:\n>\n>  (1) the series converts Emacs history without barfing; and\n>\n>  (2) you have some confidence in the conversion result after\n>      inspecting at least a handful of key release points and trees\n>      and metainformation match between the original and the\n>      converted history.\n>\n> So let's go ahead and apply these directly on top of 'master', once\n> we hear from Emacs folks and they are happy with it.  I'll queue it\n> on 'pu' so that I do not have to go back to the list archive when it\n> happens.\n\nI already heard that everything seems to be working correctly, except\none feature, the biggest change, which I screwed up with a one-liner\ncommit. That's why I added a test. Anyway, I've fixed it in my github\nbranch and in this patch series, and I've told them to try the fix.\n\nLet's see.\n\nCheers.\n\n[1] http://bzr.savannah.gnu.org/lh/emacs/xwidget/revision/101292\n[2] https://bugs.launchpad.net/bzr/+bug/541626\n\n-- \nFelipe Contreras\n"},{"id":"216153","messageId":"7vli7y8xia.fsf@alter.siamese.dyndns.org","threadId":"33689","inReplyTo":"CAMP44s3zf0Hbx4-KHVH7+wCm_czTigJo2y=wqD5Ai-9cKxZcug@mail.gmail.com","subject":"Re: [PATCH v2 00/18] remote-bzr: massive changes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-01T16:39:57Z","receivedAt":"2013-05-01T16:39:57Z","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>> So let's go ahead and apply these directly on top of 'master', once\n>> we hear from Emacs folks and they are happy with it.  I'll queue it\n>> on 'pu' so that I do not have to go back to the list archive when it\n>> happens.\n>\n> I already heard that everything seems to be working correctly, except\n> one feature, the biggest change, which I screwed up with a one-liner\n> commit. That's why I added a test. Anyway, I've fixed it in my github\n> branch and in this patch series, and I've told them to try the fix.\n\nLet us know when they make progress on that front.\n\nIf Emacs decides to switch to Git and decides to use this version of\nremote-bzr for their conversion, or at least a nontrivial group of\ndevelopers favor to do so, without seeing concrete technical points\nthat say remote-bzr is not yet ready (e.g. \"the conversion is still\nwrong and X, Y and Z needs to be fixed\"), that would be a very\nwelcome solid vote of confidence in favor of us going ahead with\nthis.\n\nThanks.\n"},{"id":"216167","messageId":"CAMP44s0n28ihRXf4f25Sx0jkg2u-eROR93bkO0Nm6X00tmkVMA@mail.gmail.com","threadId":"33689","inReplyTo":"7vli7y8xia.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2 00/18] remote-bzr: massive changes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-01T18:35:38Z","receivedAt":"2013-05-01T18:35:38Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, May 1, 2013 at 11:39 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>>> So let's go ahead and apply these directly on top of 'master', once\n>>> we hear from Emacs folks and they are happy with it.  I'll queue it\n>>> on 'pu' so that I do not have to go back to the list archive when it\n>>> happens.\n>>\n>> I already heard that everything seems to be working correctly, except\n>> one feature, the biggest change, which I screwed up with a one-liner\n>> commit. That's why I added a test. Anyway, I've fixed it in my github\n>> branch and in this patch series, and I've told them to try the fix.\n>\n> Let us know when they make progress on that front.\n>\n> If Emacs decides to switch to Git and decides to use this version of\n> remote-bzr for their conversion, or at least a nontrivial group of\n> developers favor to do so, without seeing concrete technical points\n> that say remote-bzr is not yet ready (e.g. \"the conversion is still\n> wrong and X, Y and Z needs to be fixed\"), that would be a very\n> welcome solid vote of confidence in favor of us going ahead with\n> this.\n\nSeems unlikely for political reasons (isn't it always for GNU?), since\nRMS is heavily involved in the decision.\n\n-- \nFelipe Contreras\n"},{"id":"216172","messageId":"7vehdq5yvc.fsf@alter.siamese.dyndns.org","threadId":"33689","inReplyTo":"CAMP44s0n28ihRXf4f25Sx0jkg2u-eROR93bkO0Nm6X00tmkVMA@mail.gmail.com","subject":"Re: [PATCH v2 00/18] remote-bzr: massive changes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-01T18:38:47Z","receivedAt":"2013-05-01T18:38:47Z","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 Wed, May 1, 2013 at 11:39 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>>\n>>>> So let's go ahead and apply these directly on top of 'master', once\n>>>> we hear from Emacs folks and they are happy with it.  I'll queue it\n>>>> on 'pu' so that I do not have to go back to the list archive when it\n>>>> happens.\n>>>\n>>> I already heard that everything seems to be working correctly, except\n>>> one feature, the biggest change, which I screwed up with a one-liner\n>>> commit. That's why I added a test. Anyway, I've fixed it in my github\n>>> branch and in this patch series, and I've told them to try the fix.\n>>\n>> Let us know when they make progress on that front.\n>>\n>> If Emacs decides to switch to Git and decides to use this version of\n>> remote-bzr for their conversion, or at least a nontrivial group of\n>> developers favor to do so, without seeing concrete technical points\n>> that say remote-bzr is not yet ready (e.g. \"the conversion is still\n>> wrong and X, Y and Z needs to be fixed\"), that would be a very\n>> welcome solid vote of confidence in favor of us going ahead with\n>> this.\n>\n> Seems unlikely for political reasons (isn't it always for GNU?), since\n> RMS is heavily involved in the decision.\n\nI am very aware of that discussion (and the original one when they\ndecided to use bzr).  That is exactly why I said \"at least ... favor\nto do so\".\n"},{"id":"232637","messageId":"8761q0hlbp.fsf@flea.lifelogs.com","threadId":"33689","inReplyTo":"7vehdq5yvc.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2 00/18] remote-bzr: massive changes","fromName":"Ted Zlatanov","fromEmail":"tzz@lifelogs.com","sentAt":"2014-01-03T20:17:14Z","receivedAt":"2014-01-03T20:17:14Z","isPatch":true,"sender":{"key":"tzz@lifelogs.com","avatar":"https://avatars.githubusercontent.com/u/67764?v=4"},"body":"On Wed, 01 May 2013 11:38:47 -0700 Junio C Hamano <gitster@pobox.com> wrote: \n\nJCH> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>> On Wed, May 1, 2013 at 11:39 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>>> \n>>>>> So let's go ahead and apply these directly on top of 'master', once\n>>>>> we hear from Emacs folks and they are happy with it.  I'll queue it\n>>>>> on 'pu' so that I do not have to go back to the list archive when it\n>>>>> happens.\n>>>> \n>>>> I already heard that everything seems to be working correctly, except\n>>>> one feature, the biggest change, which I screwed up with a one-liner\n>>>> commit. That's why I added a test. Anyway, I've fixed it in my github\n>>>> branch and in this patch series, and I've told them to try the fix.\n>>> \n>>> Let us know when they make progress on that front.\n>>> \n>>> If Emacs decides to switch to Git and decides to use this version of\n>>> remote-bzr for their conversion, or at least a nontrivial group of\n>>> developers favor to do so, without seeing concrete technical points\n>>> that say remote-bzr is not yet ready (e.g. \"the conversion is still\n>>> wrong and X, Y and Z needs to be fixed\"), that would be a very\n>>> welcome solid vote of confidence in favor of us going ahead with\n>>> this.\n>> \n>> Seems unlikely for political reasons (isn't it always for GNU?), since\n>> RMS is heavily involved in the decision.\n\nJCH> I am very aware of that discussion (and the original one when they\nJCH> decided to use bzr).  That is exactly why I said \"at least ... favor\nJCH> to do so\".\n\nFYI, in case you're not aware, there's a pretty strong feeling on\nemacs-devel that the switch to Git will happen and RMS is not opposed.\n\nI don't know if they'll use remote-bzr, though.  It's more likely\nthey'll use one of the already-existing mirrors and sync it up, based on\nthe feedback so far.  It's a good time to bring remote-bzr up on\nemacs-devel if you want it to be considered.\n\nHTH\nTed\n"}]}