Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
 def cmd_st(self):
     os.chdir(self.directory)
     output = system("git status --short")
     if output.strip():
         print(self.directory)
         print(output)
         print()
Ejemplo n.º 4
0
 def cmd_st(self):
     os.chdir(self.directory)
     output = system("git status --short")
     if output.strip():
         print(self.directory)
         print(output)
         print()
Ejemplo n.º 5
0
 def cmd_st(self):
     os.chdir(self.directory)
     output = system("hg st")
     if output.strip():
         print(self.directory)
         print(output)
         print()
Ejemplo n.º 6
0
 def cmd_st(self):
     os.chdir(self.directory)
     output = system("hg st")
     if output.strip():
         print(self.directory)
         print(output)
         print()
Ejemplo n.º 7
0
 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)
Ejemplo n.º 8
0
 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
Ejemplo n.º 9
0
 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
Ejemplo n.º 10
0
 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)
Ejemplo n.º 11
0
 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)
Ejemplo n.º 12
0
 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)
Ejemplo n.º 13
0
 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()
Ejemplo n.º 14
0
 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()
Ejemplo n.º 15
0
 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
Ejemplo n.º 16
0
 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
Ejemplo n.º 17
0
 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
Ejemplo n.º 18
0
 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
Ejemplo n.º 19
0
 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()
Ejemplo n.º 20
0
 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()
Ejemplo n.º 21
0
 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)
Ejemplo n.º 22
0
 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)
Ejemplo n.º 23
0
    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]))
Ejemplo n.º 24
0
    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]))
Ejemplo n.º 25
0
 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))
Ejemplo n.º 26
0
 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))
Ejemplo n.º 27
0
 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)
Ejemplo n.º 28
0
 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)
Ejemplo n.º 29
0
 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
Ejemplo n.º 30
0
 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
Ejemplo n.º 31
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("bzr up"))
Ejemplo n.º 32
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("git pull"))
Ejemplo n.º 33
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("git pull"))
Ejemplo n.º 34
0
 def cmd_rev(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("bzr revno"))
Ejemplo n.º 35
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("hg pull -u %s" % self.url))
Ejemplo n.º 36
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("svn up --non-interactive"))
Ejemplo n.º 37
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("hg pull -u %s" % self.url))
Ejemplo n.º 38
0
 def cmd_rev(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("bzr revno"))
Ejemplo n.º 39
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("bzr up"))
Ejemplo n.º 40
0
 def cmd_rev(self):
     print(self.directory)
     os.chdir(self.directory)
     output = system("svn info")
     print(self._parse_last_changed(output))
Ejemplo n.º 41
0
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."'))
Ejemplo n.º 42
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("svn up --non-interactive"))
Ejemplo n.º 43
0
 def cmd_rev(self):
     print(self.directory)
     os.chdir(self.directory)
     output = system("svn info")
     print(self._parse_last_changed(output))
Ejemplo n.º 44
0
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."'))