Exemple #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
Exemple #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
Exemple #3
0
 def cmd_st(self):
     os.chdir(self.directory)
     output = system("git status --short")
     if output.strip():
         print(self.directory)
         print(output)
         print()
Exemple #4
0
 def cmd_st(self):
     os.chdir(self.directory)
     output = system("git status --short")
     if output.strip():
         print(self.directory)
         print(output)
         print()
Exemple #5
0
 def cmd_st(self):
     os.chdir(self.directory)
     output = system("hg st")
     if output.strip():
         print(self.directory)
         print(output)
         print()
Exemple #6
0
 def cmd_st(self):
     os.chdir(self.directory)
     output = system("hg st")
     if output.strip():
         print(self.directory)
         print(output)
         print()
Exemple #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)
Exemple #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
Exemple #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
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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()
Exemple #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()
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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()
Exemple #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()
Exemple #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)
Exemple #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)
Exemple #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]))
Exemple #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]))
Exemple #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))
Exemple #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))
Exemple #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)
Exemple #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)
Exemple #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
Exemple #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
Exemple #31
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("bzr up"))
Exemple #32
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("git pull"))
Exemple #33
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("git pull"))
Exemple #34
0
 def cmd_rev(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("bzr revno"))
Exemple #35
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("hg pull -u %s" % self.url))
Exemple #36
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("svn up --non-interactive"))
Exemple #37
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("hg pull -u %s" % self.url))
Exemple #38
0
 def cmd_rev(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("bzr revno"))
Exemple #39
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("bzr up"))
Exemple #40
0
 def cmd_rev(self):
     print(self.directory)
     os.chdir(self.directory)
     output = system("svn info")
     print(self._parse_last_changed(output))
Exemple #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."'))
Exemple #42
0
 def cmd_up(self):
     print(self.directory)
     os.chdir(self.directory)
     print(system("svn up --non-interactive"))
Exemple #43
0
 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."'))