def cmd_in(self): os.chdir(self.directory) output = system("svn info") local_rev = self._parse_last_changed(output) try: output = system("svn info -r HEAD") remote_rev = self._parse_last_changed(output) if remote_rev > local_rev: print(self.directory) print("Incoming changes : " "Revision {0} to {1}".format(local_rev, remote_rev)) except CommandError: print("Could not connect to repository for " + self.directory) return
def cmd_st(self): os.chdir(self.directory) output = system("git status --short") if output.strip(): print(self.directory) print(output) print()
def cmd_st(self): os.chdir(self.directory) output = system("hg st") if output.strip(): print(self.directory) print(output) print()
def cmd_in(self): output = system("git pull --dry-run") output = output.strip() output_lines = output.split('\n') if len(output_lines): print("'git pull --dry-run' reports possible actions in %s:" % ( self.directory)) print(output)
def cmd_in(self): os.chdir(self.directory) try: system("bzr missing --theirs-only") except CommandError as e: if e.returncode == 1: # bzr returns 1 if there are incoming changes! print(self.directory) print("'bzr missing' reports incoming changesets : ") print(e.output) return if e.returncode == 3: # bzr returns 3 if there is no parent pass else: raise return
def cmd_in(self): output = system("git pull --dry-run") output = output.strip() output_lines = output.split('\n') if output and len(output_lines): print("'git pull --dry-run' reports possible actions in %s:" % ( self.directory)) print(output)
def cmd_out(self): os.chdir(self.directory) output = system("git push --dry-run") output = output.strip() output_lines = output.split('\n') if len(output_lines) > 1: # More than the 'everything up-to-date' one-liner. print("'git push --dry-run' reports possible actions in %s:" % ( self.directory)) print(output)
def cmd_st(self): os.chdir(self.directory) output = system("svn st --ignore-externals") lines = [line.strip() for line in output.splitlines() if line.strip() and not line.startswith('X')] if lines: print(self.directory) print(output) print()
def cmd_rev(self): print(self.directory) os.chdir(self.directory) output = system("hg log -l1") lines = [line.strip() for line in output.splitlines() if line.strip()] for line in lines: m = self.regex_changeset.match(line.lower()) if m: print("{0}:{1}".format(m.group('num'), m.group('digest'))) return
def cmd_rev(self): print(self.directory) os.chdir(self.directory) output = system("git show -q") lines = [line.strip() for line in output.splitlines() if line.strip()] for line in lines: m = self.regex_commit_digest.match(line.lower()) if m: print(m.group('object')) return
def cmd_upgrade(self): # Run 'svn upgrade'. This upgrades the working copy to the # new subversion 1.7 layout of the .svn directory. os.chdir(self.directory) output = system("svn upgrade --quiet") lines = [line.strip() for line in output.splitlines() if line.strip() and not line.startswith('X')] print(self.directory) if lines: print(output) print()
def cmd_out(self): os.chdir(self.directory) try: output = system("bzr missing %s --mine-only" % self.url) except CommandError as e: if e.returncode == 1: # bzr returns 1 if there are outgoing changes! print("Unpushed outgoing changes in %s:" % self.directory) print(e.output) return else: raise print(output)
def cmd_co(self): if not os.path.exists(self.parent): print("Creating parent dir %s" % self.parent) os.makedirs(self.parent) if self.exists: answer = PRESENT else: answer = CREATED os.chdir(self.parent) print(system("bzr checkout %s %s" % ( self.url, self.directory))) print(' '.join([answer, self.directory]))
def cmd_info(self): # This is useful when your svn program has been updated and # the security mechanisms on your OS now require you to # explictly allow access to the stored credentials. The other # commands either do not access the internet or are # non-interactive (like command up). In fact, the reason for # adding this command is that a non-interactive 'svn update' # will fail when you have not granted access to your # credentials yet for this new svn program. This has happened # a bit too often for me (Maurits). os.chdir(self.directory) # Determine the version. output = system("svn --version --quiet") try: version = float(output[:3]) except (ValueError, TypeError, IndexError): version = 0.0 # Since version 1.8 we must use --force-interactive, which is # unavailable in earlier versions. if version < 1.8: print(system("svn info %s" % self.url)) else: print(system("svn info --force-interactive %s" % self.url))
def cmd_out(self): os.chdir(self.directory) try: output = system("hg out %s" % self.url) except CommandError as e: if e.returncode == 1: # hg returns 1 if there are no outgoing changes! # Checkoutmanager is as quiet as possible, so we print # nothing. return else: raise # No errors means we have genuine outgoing changes. print("Unpushed outgoing changes in %s:" % self.directory) print(output)
def cmd_in(self): os.chdir(self.directory) try: output = system("hg incoming") print(self.directory) print("'hg incoming' reports incoming changesets :" % ( self.directory)) print(output) except CommandError as e: if e.returncode == 1: # hg returns 1 if there are no incoming changes. return elif e.returncode == 255: # hg returns 255 if there is no default parent. pass else: raise return
def cmd_up(self): print(self.directory) os.chdir(self.directory) print(system("bzr up"))
def cmd_up(self): print(self.directory) os.chdir(self.directory) print(system("git pull"))
def cmd_rev(self): print(self.directory) os.chdir(self.directory) print(system("bzr revno"))
def cmd_up(self): print(self.directory) os.chdir(self.directory) print(system("hg pull -u %s" % self.url))
def cmd_up(self): print(self.directory) os.chdir(self.directory) print(system("svn up --non-interactive"))
def cmd_rev(self): print(self.directory) os.chdir(self.directory) output = system("svn info") print(self._parse_last_changed(output))
def test_action(dirinfo, **kwargs): print('Test action') print('dirinfo: %s' % dirinfo) print('arguments: %s' % ', '.join('%s: %s' % (k, v) for (k, v) in sorted(kwargs.items()))) print(utils.system('echo "echo command executed."'))
def test_action(dirinfo, **kwargs): print('Test action') print('dirinfo: %s' % dirinfo) print('arguments: %s' % ', '.join( '%s: %s' % (k, v) for (k, v) in sorted(kwargs.items()))) print(utils.system('echo "echo command executed."'))