[Asterisk-code-review] digium git: Add additional capabilities for manipulating bra... (repotools[master])

Matt Jordan asteriskteam at digium.com
Tue May 19 20:33:55 CDT 2015


Matt Jordan has posted comments on this change.

Change subject: digium_git: Add additional capabilities for manipulating branches/tags
......................................................................


Patch Set 3:

(5 comments)

https://gerrit.asterisk.org/#/c/381/3/digium_git.py
File digium_git.py:

Line 164: if not local_name:
        :             local_name = branch_name
        :         if local_name in self.repo.heads:
        :             # Local version already exists, just use it
        :             local_branch = self.repo.heads[local_name]
        :         else:
        :             origin = self.repo.remotes.origin
        :             remote_ref = [ref for ref in origin.refs
        :                           if branch_name in ref.name][0]
        :             local_branch = self.repo.create_head(local_name, remote_ref)
        :             local_branch.set_tracking_branch(remote_ref)
        :         local_branch.checkout()
> Could use whitespace.
Fixed


Line 184: tag = self.get_tag(name)
        :         if tag:
        :             self.repo.head.reference = tag
        :         else:
        :             local_branch = self.repo.heads[name]
        :             self.repo.head.reference = local_branch
        :         assert not self.repo.head.is_detached
        :         self.repo.head.reset(index=True, working_tree=True)
> Could use whitespace.
Fixed


Line 223:         Raises an exception if tag_name is not found.
> It looks like get_tag no longer raises an exception so this comment can be 
Fixed.


Line 242: if self.get_tag(tag_name):
        :             raise ValueError("Tag '{0}' already exists!".format(tag_name))
        :         self.repo.create_tag(tag_name, message="Create '{0}'".format(tag_name))
        :         origin = self.repo.remotes.origin
        :         if self.show_progress:
        :             progress = GitProgressBar()
        :         origin.push(progress=progress, tags=True)
> Could use whitespace.
Fixed.


Line 245:         origin = self.repo.remotes.origin
        :         if self.show_progress:
        :             progress = GitProgressBar()
        :         origin.push(progress=progress, tags=True)
> If show_progress is false then progress is unreferenced in the push call. H
Actually, it needs to pass 'tags=True', which is why it doesn't call push_changes directly. I thought about making push_changes also take a tags parameter, but at some point in time, you're just exposing the full GitPython API, which obviates the need for the library.

I'll add a 'progress=None' prior to this.


-- 
To view, visit https://gerrit.asterisk.org/381
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2d13af5a8201d349b37f64f9855e45b70309aa95
Gerrit-PatchSet: 3
Gerrit-Project: repotools
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Samuel Galarneau <sgalarneau at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list