Exemplo n.º 1
0
 def create_tag(self, dir, tagid, name, version, push):
     rc = self.process.system(
         'hg tag -m"Tagged %(name)s %(version)s." "%(tagid)s"' % locals())
     if rc != 0:
         err_exit('Tag failed')
     if push:
         if self.is_remote_sandbox(dir):
             rc = self.process.system('hg push default')
             if rc != 0:
                 err_exit('Push failed')
         else:
             warn('No default path found; not pushing the tag')
     return rc
Exemplo n.º 2
0
 def create_tag(self, dir, tagid, name, version, push):
     rc = self.process.system(
         'hg tag -m"Tagged %(name)s %(version)s." "%(tagid)s"' % locals())
     if rc != 0:
         err_exit('Tag failed')
     if push:
         if self.is_remote_sandbox(dir):
             rc = self.process.system(
                 'hg push default')
             if rc != 0:
                 err_exit('Push failed')
         else:
             warn('No default path found; not pushing the tag')
     return rc
Exemplo n.º 3
0
 def create_tag(self, dir, tagid, name, version, push):
     rc = self.process.system(
         'git tag -m"Tagged %(name)s %(version)s." "%(tagid)s"' % locals())
     if rc != 0:
         err_exit('Tag failed')
     remote = self.get_remote_from_sandbox(dir)
     if push and remote:
         branch = self.get_branch_from_sandbox(dir)
         tracked = self.get_tracked_branch_from_sandbox(dir)
         if tracked:
             rc = self.process.system(
                 'git push "%(remote)s" tag "%(tagid)s"' % locals())
             if rc != 0:
                 err_exit('Push failed')
         else:
             warn('%(branch)s does not track any branch - '
                 'not pushing the tag' % locals())
     return rc
Exemplo n.º 4
0
 def checkin_sandbox(self, dir, name, version, push):
     rc = self.process.system(
         'git commit -m"Prepare %(name)s %(version)s." .' % locals())
     if rc not in (0, 1):
         err_exit('Commit failed')
     rc = 0
     remote = self.get_remote_from_sandbox(dir)
     if push and remote:
         branch = self.get_branch_from_sandbox(dir)
         tracked = self.get_tracked_branch_from_sandbox(dir)
         if tracked:
             rc = self.process.system(
                 'git push "%(remote)s" "%(branch)s:%(tracked)s"' % locals())
             if rc != 0:
                 err_exit('Push failed')
         else:
             warn('%(branch)s does not track any branch - '
                 'not pushing the commit' % locals())
     return rc
Exemplo n.º 5
0
 def commit_sandbox(self, dir, name, version, push):
     rc = self.process.system(
         'hg commit -v -m"Prepare %(name)s %(version)s." .' % locals())
     if rc not in (0, 1):  # 1 means empty commit
         err_exit('Commit failed')
     rc = 0
     if push:
         if self.is_remote_sandbox(dir):
             rc = self.process.system('hg push default')
             if self.version_info[:2] >= (2, 1):
                 if rc not in (0, 1):  # 1 means empty push
                     err_exit('Push failed')
                 rc = 0
             else:
                 if rc != 0:
                     err_exit('Push failed')
         else:
             warn('No default path found; not pushing the commit')
     return rc
Exemplo n.º 6
0
 def create_tag(self, dir, tagid, name, version, push):
     rc = self.process.system(
         'git tag -m"Tagged %(name)s %(version)s." "%(tagid)s"' % locals())
     if rc != 0:
         err_exit('Tag failed')
     if push:
         branch = self.get_branch_from_sandbox(dir)
         remote = self.get_remote_from_sandbox(dir)
         if remote:
             tracked = self.get_tracked_branch_from_sandbox(dir)
             if tracked:
                 rc = self.process.system(
                     'git push "%(remote)s" tag "%(tagid)s"' % locals())
                 if rc != 0:
                     err_exit('Push failed')
                 return rc
         warn('%(branch)s does not track a remote branch; '
              'not pushing the tag' % locals())
     return rc
Exemplo n.º 7
0
 def commit_sandbox(self, dir, name, version, push):
     rc = self.process.system(
         'hg commit -v -m"Prepare %(name)s %(version)s." .' % locals())
     if rc not in (0, 1):    # 1 means empty commit
         err_exit('Commit failed')
     rc = 0
     if push:
         if self.is_remote_sandbox(dir):
             rc = self.process.system(
                 'hg push default')
             if self.version_info[:2] >= (2, 1):
                 if rc not in (0, 1):    # 1 means empty push
                     err_exit('Push failed')
                 rc = 0
             else:
                 if rc != 0:
                     err_exit('Push failed')
         else:
             warn('No default path found; not pushing the commit')
     return rc
Exemplo n.º 8
0
 def commit_sandbox(self, dir, name, version, push):
     rc = self.process.system(
         'git commit -m"Prepare %(name)s %(version)s." .' % locals())
     if rc not in (0, 1):
         err_exit('Commit failed')
     rc = 0
     if push:
         branch = self.get_branch_from_sandbox(dir)
         remote = self.get_remote_from_sandbox(dir)
         if remote:
             tracked = self.get_tracked_branch_from_sandbox(dir)
             if tracked:
                 rc = self.process.system(
                     'git push "%(remote)s" "%(branch)s:%(tracked)s"' %
                     locals())
                 if rc != 0:
                     err_exit('Push failed')
                 return rc
         warn('%(branch)s does not track a remote branch; '
              'not pushing the commit' % locals())
     return rc