Rev 116: Merge fix to use active branch. in http://people.samba.org/bzr/jelmer/bzr-git/trunk

Jelmer Vernooij jelmer at samba.org
Tue Nov 25 03:58:37 GMT 2008


At http://people.samba.org/bzr/jelmer/bzr-git/trunk

------------------------------------------------------------
revno: 116
revision-id: jelmer at samba.org-20081125035836-vn21fn0c3y16d4yz
parent: jelmer at samba.org-20081125035740-ngekd1kq7ons9rpk
parent: eric at pixelwareinc.com-20081125014522-leeq8vts9nv3awjm
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Tue 2008-11-25 04:58:36 +0100
message:
  Merge fix to use active branch.
modified:
  dir.py                         git_dir.py-20071108234408-ygidvy5hviixghsd-1
    ------------------------------------------------------------
    revno: 110.3.1
    revision-id: eric at pixelwareinc.com-20081125014522-leeq8vts9nv3awjm
    parent: jelmer at samba.org-20081005154531-scvfgpqyvttsqogj
    committer: Eric Anderson <eric at pixelwareinc.com>
    branch nick: git
    timestamp: Mon 2008-11-24 20:45:22 -0500
    message:
      When reading branch use active branch instead of first branch.
      
      This allows us to interact with whatever is set as the current active 
      branch instead of being limited to only the first branch (master). 
      Useful for creating a branch from somewhere other than master.
      
      Limited in its usefulness as I believe git only allows switching 
      branches in a non-bare repositories and most trees being branched from 
      are bare repositories. Also requiring the source repository to switch
      its active branch is pretty intrusive. But something is better than
      nothing.
    modified:
      dir.py                         git_dir.py-20071108234408-ygidvy5hviixghsd-1
=== modified file 'dir.py'
--- a/dir.py	2008-09-06 13:42:22 +0000
+++ b/dir.py	2008-11-25 01:45:22 +0000
@@ -97,7 +97,7 @@
         if repo._git.heads == []:
             head = None
         else:
-            head = repo._git.heads[0].commit.id
+            head = filter(lambda h: h.name == repo._git.active_branch, repo._git.heads)[0].commit.id
         return branch.GitBranch(self, repo, head, 
                                     self.root_transport.base, self._lockfiles)
 




More information about the bazaar-commits mailing list