]> arthur.barton.de Git - bup.git/commitdiff
Use absolute_import from the __future__ everywhere
authorRob Browning <rlb@defaultvalue.org>
Sat, 27 Jan 2018 17:40:02 +0000 (11:40 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sat, 27 Jan 2018 17:45:11 +0000 (11:45 -0600)
Without this, among other things, we can end up with conflicts with
new upstream modules.  For example, given lib/bup/io.py:

  Traceback (most recent call last):
    File "/home/rlb/src/bup/main-4/cmd/bup-index", line 10, in <module>
      from bup import metadata, options, git, index, drecurse, hlinkdb
    File "/home/rlb/src/bup/main-4/lib/bup/metadata.py", line 10, in <module>
      from io import BytesIO
  ImportError: cannot import name BytesIO

This switch also revealed a circular dependency between midx and git,
and several places where we weren't qualifying our bup imports
properly, i.e. "import git" rather than "from bup import git".

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
85 files changed:
buptest.py
cmd/bloom-cmd.py
cmd/cat-file-cmd.py
cmd/daemon-cmd.py
cmd/damage-cmd.py
cmd/drecurse-cmd.py
cmd/fsck-cmd.py
cmd/ftp-cmd.py
cmd/fuse-cmd.py
cmd/gc-cmd.py
cmd/help-cmd.py
cmd/import-duplicity-cmd.py
cmd/index-cmd.py
cmd/init-cmd.py
cmd/join-cmd.py
cmd/list-idx-cmd.py
cmd/ls-cmd.py
cmd/margin-cmd.py
cmd/memtest-cmd.py
cmd/meta-cmd.py
cmd/midx-cmd.py
cmd/mux-cmd.py
cmd/on--server-cmd.py
cmd/on-cmd.py
cmd/prune-older-cmd.py
cmd/random-cmd.py
cmd/restore-cmd.py
cmd/rm-cmd.py
cmd/save-cmd.py
cmd/server-cmd.py
cmd/split-cmd.py
cmd/tag-cmd.py
cmd/tick-cmd.py
cmd/version-cmd.py
cmd/web-cmd.py
cmd/xstat-cmd.py
lib/bup/bloom.py
lib/bup/client.py
lib/bup/compat.py
lib/bup/csetup.py
lib/bup/drecurse.py
lib/bup/gc.py
lib/bup/git.py
lib/bup/hashsplit.py
lib/bup/helpers.py
lib/bup/hlinkdb.py
lib/bup/index.py
lib/bup/ls.py
lib/bup/metadata.py
lib/bup/midx.py
lib/bup/options.py
lib/bup/path.py
lib/bup/repo.py
lib/bup/rm.py
lib/bup/shquote.py
lib/bup/ssh.py
lib/bup/t/__init__.py
lib/bup/t/tbloom.py
lib/bup/t/tclient.py
lib/bup/t/tgit.py
lib/bup/t/thashsplit.py
lib/bup/t/thelpers.py
lib/bup/t/tindex.py
lib/bup/t/tmetadata.py
lib/bup/t/toptions.py
lib/bup/t/tshquote.py
lib/bup/t/tvfs.py
lib/bup/t/tvint.py
lib/bup/t/txstat.py
lib/bup/version.py
lib/bup/vfs.py
lib/bup/vint.py
lib/bup/xstat.py
main.py
t/data-size
t/hardlink-sets
t/id-other-than
t/mksock
t/ns-timestamp-resolutions
t/root-status
t/subtree-hash
t/test-ftp
t/test-prune-older
t/unknown-owner
wvtest.py

index 14ca1c388e58c1a3d7bc967fa1ec812109445d22..5d4fe05029643f9ba7049f479ed52e2b4f794039 100644 (file)
@@ -1,5 +1,5 @@
 
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 from collections import namedtuple
 from contextlib import contextmanager
 from os.path import basename, dirname, realpath
 from collections import namedtuple
 from contextlib import contextmanager
 from os.path import basename, dirname, realpath
index ecf244c18a3a4f246ee44e91fbdb924a24d2599e..0e7fbf4986facb51491c9539e4c6e5ed28b401fe 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import glob, os, sys, tempfile
 
 from bup import options, git, bloom
 import glob, os, sys, tempfile
 
 from bup import options, git, bloom
index 8aabb41069c2f3776e7ff38753f24a2765b732e4..06e14f69a38cca150cf31b508ad1d1cd9858a7fc 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import re, stat, sys
 
 from bup import options, git, vfs
 import re, stat, sys
 
 from bup import options, git, vfs
index 8386fc0e120983252da06dbfe80c8b79a98c4ddb..ba4b86a50f8917bf697e2a45864cfecb8ddb97ba 100755 (executable)
@@ -4,6 +4,8 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
+from __future__ import absolute_import
 import sys, getopt, socket, subprocess, fcntl
 from bup import options, path
 from bup.helpers import *
 import sys, getopt, socket, subprocess, fcntl
 from bup import options, path
 from bup.helpers import *
index 669148ad565a17ec9c5da168459bb8d4d72eec56..fa54bc90c90baa9003927213c509cd2b850e7082 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys, os, random
 
 from bup import options
 import sys, os, random
 
 from bup import options
index bc537cbd96044c155d915212a353d7fbb81aa252..21ee3a55b45592d9a640f81af3951575ef4b532c 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 from os.path import relpath
 import sys
 
 from os.path import relpath
 import sys
 
index 8c4d0b7e842f8431a6d5315e2d802dcafede4691..df43b67080853511670b55ac83655278f0049a53 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys, os, glob, subprocess
 
 from bup import options, git
 import sys, os, glob, subprocess
 
 from bup import options, git
index ee2bff1218138d2539b10fb7996c32d8569f04c6..8bd57b6d81accff181dde968af13f865f3979348 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys, os, stat, fnmatch
 
 from bup import options, git, shquote, ls, vfs
 import sys, os, stat, fnmatch
 
 from bup import options, git, shquote, ls, vfs
index ab0ec7e28df273161f74e823c82a39b7bec97eb0..d05bd5f2bae2a9d13468cf3e70d9476b8b54468f 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys, os, errno
 
 try:
 import sys, os, errno
 
 try:
index e0782ca3f625701e0ed678e94daad5feb6c0138d..c4eeaffa8d4f9b430d81e0d69904390d13cf2c39 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys
 
 from bup import git, options
 import sys
 
 from bup import git, options
index 95155b6ad28d8dde6904367e484ffafb0edc086c..384d0cfa9f2ae4bbafca345cadf6b9cffa0a552d 100755 (executable)
@@ -4,6 +4,8 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
+from __future__ import absolute_import
 import sys, os, glob
 from bup import options, path
 
 import sys, os, glob
 from bup import options, path
 
index 812b6c7844feaa15038f9b2860637904a0ea9264..565aca629c8cbca365152a4badddb1d11a794942 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 from calendar import timegm
 from pipes import quote
 from subprocess import check_call
 from calendar import timegm
 from pipes import quote
 from subprocess import check_call
index 2426f1f5ac8b54fee6e3f6c164c8e6f87a38a0f1..539e89ef5019839d67669096593e783d532366e0 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys, stat, time, os, errno, re
 
 from bup import metadata, options, git, index, drecurse, hlinkdb
 import sys, stat, time, os, errno, re
 
 from bup import metadata, options, git, index, drecurse, hlinkdb
index f2c0052bd5fd0d16811d8d809f52e8819c2c85a4..412ecec1907e2f8b655acc356f1059b4d757419c 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys
 
 from bup import git, options, client
 import sys
 
 from bup import git, options, client
index b445e4dced2acde43d2d7eee79be295941f659fc..68c31eedcb7e24f7d54927d40017f5dedfc20c77 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys
 
 from bup import git, options
 import sys
 
 from bup import git, options
index d2c981bf635b6b1392898660e950edabded350da..227d8fe48afccb7195e7bff3b3d841f29fdd765a 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys, os
 
 from bup import git, options
 import sys, os
 
 from bup import git, options
index 7dacce708a5c7ad7c4a9448800e4f2f748d659c5..9180da3a7635d2df45b7b7c6c1d0806ba9924a38 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys
 
 from bup import git, ls
 import sys
 
 from bup import git, ls
index ca502b90cd9768fbb95815b7a25e903e6b759c6a..c042bf88bab8dd3795cb75d3e6f2bf2df44c3109 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys, struct, math
 
 from bup import options, git, _helpers
 import sys, struct, math
 
 from bup import options, git, _helpers
index fb7a1205ed17e55c05d0e0824797b0ff9518243b..894bb64366a20543cc50d2bcce3874871ca3eec3 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys, re, struct, time, resource
 
 from bup import git, bloom, midx, options, _helpers
 import sys, re, struct, time, resource
 
 from bup import git, bloom, midx, options, _helpers
index 671abce43e99974090caa878ba699055475f7a38..38ec94348e02fc3ddca871032a0335390ce753eb 100755 (executable)
@@ -12,6 +12,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 
 # TODO: Add tar-like -C option.
 
 
 # TODO: Add tar-like -C option.
 
+from __future__ import absolute_import
 import sys
 from bup import metadata
 from bup import options
 import sys
 from bup import metadata
 from bup import options
index 7b4a2adc689c535cc948395ea0fbdb3497b3198b..1b81174df66f4531ca9f1ee2a903663f77667c33 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import glob, math, os, resource, struct, sys, tempfile
 
 from bup import options, git, midx, _helpers, xstat
 import glob, math, os, resource, struct, sys, tempfile
 
 from bup import options, git, midx, _helpers, xstat
index b7a6db12882d39c648749879842e0d1375ebaaff..3b5524415e5f916bfd03b846494cfc8bccc3ed69 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import os, sys, subprocess, struct
 
 from bup import options
 import os, sys, subprocess, struct
 
 from bup import options
index cdfd44113c352e3560a521e97d7e915344b7ee07..0d29e4316a92831884c77f51b652a0cd791f9855 100755 (executable)
@@ -4,6 +4,8 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
+from __future__ import absolute_import
 import sys, os, struct
 from bup import options, helpers
 
 import sys, os, struct
 from bup import options, helpers
 
index 10b1e3f249710aae44fae64faa4af83a81624bd6..e4f660c10bf15b4ba901ea2a9acc44004cb711bd 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys, os, struct, getopt, subprocess, signal
 
 from subprocess import PIPE
 import sys, os, struct, getopt, subprocess, signal
 
 from subprocess import PIPE
index 58c4d946f292b87d5a24dc0416db382034bdbdaf..6c67b69bfc72e1e717d6abfa6c5cd1aea3b12c66 100755 (executable)
@@ -5,7 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 from collections import defaultdict
 from itertools import groupby
 from sys import stderr
 from collections import defaultdict
 from itertools import groupby
 from sys import stderr
index 868c3afd3fcebf2a775bc7e5e5a0b63dfd31239b..3eef820143be8ed3f506ce4af8381c6511fdca71 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import os, sys
 
 from bup import options, _helpers
 import os, sys
 
 from bup import options, _helpers
index a9dbd3df78a715b70f7d2b9c7042e593d08d8611..bb37811b447518a7a1edb09b36fc32d28c4bca8a 100755 (executable)
@@ -5,7 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 from stat import S_ISDIR
 import copy, errno, os, sys, stat, re
 
 from stat import S_ISDIR
 import copy, errno, os, sys, stat, re
 
index 13cb058a4586abbc92b73e80733a9fabdb4ac539..3464e3c3078ca874494153a72effc553b1b15572 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import sys
 
 from bup.git import check_repo_or_die
 import sys
 
 from bup.git import check_repo_or_die
index f06e3a46d2b0933260cc52fb9220f10fe9f0bc5a..91d01ca84912dfa2f0e5ca5a1069f816fc06ede6 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 from errno import EACCES
 from io import BytesIO
 import os, sys, stat, time, math
 from errno import EACCES
 from io import BytesIO
 import os, sys, stat, time, math
index d13abc92935013e8b9ecc9944d31bd577f5b22b3..a60bf2305eefaa1b9e5693a52affdb34628e4d91 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import os, sys, struct, subprocess
 
 from bup import options, git
 import os, sys, struct, subprocess
 
 from bup import options, git
index 80c7e0d0cce4ac66338445eb6fbf3eb44a8ae7d7..031a266acd3b8f42e8266a40de8b2c2fcfdada76 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import os, sys, time
 
 from bup import hashsplit, git, options, client
 import os, sys, time
 
 from bup import hashsplit, git, options, client
index 492c3baad833631f7248553be60d1e48ea427f16..00647b973ba3f1e3cbc8fb4595b905c951ff64f6 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import os, sys
 
 from bup import git, options
 import os, sys
 
 from bup import git, options
index ce3d399c94f9447c6d4cf169ac3ab5baaecca5c8..30e1d50f85815e5c8df77b2ad1d1818d18e71549 100755 (executable)
@@ -4,6 +4,8 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
+from __future__ import absolute_import
 import sys, time
 from bup import options
 
 import sys, time
 from bup import options
 
index 9b23ea2726ce65656e052b944e9fdcede7cc2888..f7555a8aeaef8078d617cc41c1b7df089139cc46 100755 (executable)
@@ -5,7 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 import re, sys
 
 from bup import options
 import re, sys
 
 from bup import options
index 9fdc322295f2c3488b7a80e3b1fecd2fc605b557..810af2d069e610e8a8c054a9c7fd2391016f8c6e 100755 (executable)
@@ -5,7 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 from collections import namedtuple
 import mimetypes, os, posixpath, signal, stat, sys, time, urllib, webbrowser
 
 from collections import namedtuple
 import mimetypes, os, posixpath, signal, stat, sys, time, urllib, webbrowser
 
index 9f328458c3a343c7bf87fc6c471dd411815418c8..aa43a53438a7a558b58701211108d08ad15ef190 100755 (executable)
@@ -4,11 +4,15 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 # Copyright (C) 2010 Rob Browning
 #
 # This code is covered under the terms of the GNU Library General
 # Public License as described in the bup LICENSE file.
 # Copyright (C) 2010 Rob Browning
 #
 # This code is covered under the terms of the GNU Library General
 # Public License as described in the bup LICENSE file.
+
+from __future__ import absolute_import
 import sys, stat, errno
 import sys, stat, errno
+
 from bup import metadata, options, xstat
 from bup.helpers import add_error, handle_ctrl_c, parse_timestamp, saved_errors, \
     add_error, log
 from bup import metadata, options, xstat
 from bup.helpers import add_error, handle_ctrl_c, parse_timestamp, saved_errors, \
     add_error, log
index 77878669686a066caffbc3532974aa240d5df6ed..54da4b8cc8fed08971f17a56a08da5352354ca77 100644 (file)
@@ -80,6 +80,7 @@ None of this tells us what max_pfalse_positive to choose.
 Brandon Low <lostlogic@lostlogicx.com> 2011-02-04
 """
 
 Brandon Low <lostlogic@lostlogicx.com> 2011-02-04
 """
 
+from __future__ import absolute_import
 import sys, os, math, mmap, struct
 
 from bup import _helpers
 import sys, os, math, mmap, struct
 
 from bup import _helpers
index 7b786eb0dc1aa0d0885842c9655c65c20a4ddedc..8c364d19b401ddfa5368716f7c3d722f7c0a0bed 100644 (file)
@@ -1,4 +1,5 @@
 
 
+from __future__ import absolute_import
 import errno, os, re, struct, sys, time, zlib
 
 from bup import git, ssh
 import errno, os, re, struct, sys, time, zlib
 
 from bup import git, ssh
index 51aabf8db38a4839ca8b5d47a9d31e83b113f84a..8a142822f4f84d7f00441d7224864b5f478a1958 100644 (file)
@@ -1,5 +1,5 @@
 
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 from traceback import print_exception
 import sys
 
 from traceback import print_exception
 import sys
 
index 2446fe6fd4968dd7ef965d254dd525734b9018af..1cebf76f211dce1c87a037566afc9fca115390d1 100644 (file)
@@ -1,3 +1,6 @@
+
+from __future__ import absolute_import
+
 from distutils.core import setup, Extension
 
 _helpers_mod = Extension('_helpers',
 from distutils.core import setup, Extension
 
 _helpers_mod = Extension('_helpers',
index 14bb7212a9ecb3e5466f8236ed9674a9420d2332..24a0db941538e68b95d2db061d16b6b0d2b30073 100644 (file)
@@ -1,4 +1,5 @@
 
 
+from __future__ import absolute_import
 import stat, os
 
 from bup.helpers import add_error, should_rx_exclude_path, debug1, resolve_parent
 import stat, os
 
 from bup.helpers import add_error, should_rx_exclude_path, debug1, resolve_parent
index d05357c6572a87c6223aadba3caf4e38163d913f..29d5ad83a1a1e957554ae314bf700ae2c443d699 100644 (file)
@@ -1,3 +1,5 @@
+
+from __future__ import absolute_import
 import glob, os, subprocess, sys, tempfile
 from bup import bloom, git, midx
 from bup.git import MissingObject, walk_object
 import glob, os, subprocess, sys, tempfile
 from bup import bloom, git, midx
 from bup.git import MissingObject, walk_object
index 8150f7c0c593ef3a1795b0866ee16b8a1b3282f7..70673a3d2f8377f1329d254cbb002b995c75ebd4 100644 (file)
@@ -3,6 +3,7 @@ bup repositories are in Git format. This library allows us to
 interact with the Git data structures.
 """
 
 interact with the Git data structures.
 """
 
+from __future__ import absolute_import
 import errno, os, sys, zlib, time, subprocess, struct, stat, re, tempfile, glob
 from collections import namedtuple
 from itertools import islice
 import errno, os, sys, zlib, time, subprocess, struct, stat, re, tempfile, glob
 from collections import namedtuple
 from itertools import islice
index 3a4fcb840ea97695d3d283e938ce444b1b6a03c3..3cbcfc981b4e1280604712b2b0ffe2fbeff9411e 100644 (file)
@@ -1,3 +1,5 @@
+
+from __future__ import absolute_import
 import io, math, os
 
 from bup import _helpers, helpers
 import io, math, os
 
 from bup import _helpers, helpers
index 4ead99ad76085a6274668f20fcd6cf052aa3d5a2..583c65b4bf07f040102c153638ff2d1c62b245a2 100644 (file)
@@ -1,5 +1,6 @@
 """Helper functions and classes for bup."""
 
 """Helper functions and classes for bup."""
 
+from __future__ import absolute_import
 from collections import namedtuple
 from contextlib import contextmanager
 from ctypes import sizeof, c_void_p
 from collections import namedtuple
 from contextlib import contextmanager
 from ctypes import sizeof, c_void_p
index 5c1ec0099621b46130217c4622937b7617473e7c..17957bd9a6bb54888c9daef6d4e95bfcae0e6b1d 100644 (file)
@@ -1,3 +1,5 @@
+
+from __future__ import absolute_import
 import cPickle, errno, os, tempfile
 
 from bup import compat
 import cPickle, errno, os, tempfile
 
 from bup import compat
index a4880867cb0e343ea9f19fa9a18677f141442e64..d6d44accb7eb0b320526283cd174513d3f1a84ed 100644 (file)
@@ -1,6 +1,8 @@
-import errno, metadata, os, stat, struct, tempfile
 
 
-from bup import xstat
+from __future__ import absolute_import
+import errno, os, stat, struct, tempfile
+
+from bup import metadata, xstat
 from bup._helpers import UINT_MAX, bytescmp
 from bup.helpers import (add_error, log, merge_iter, mmap_readwrite,
                          progress, qprogress, resolve_parent, slashappend)
 from bup._helpers import UINT_MAX, bytescmp
 from bup.helpers import (add_error, log, merge_iter, mmap_readwrite,
                          progress, qprogress, resolve_parent, slashappend)
index 78717ac1dc2d4072f6f830537350b12e1f004ddf..7b3d9eae681ada1995b901bbcbb15647913d7f98 100644 (file)
@@ -1,14 +1,14 @@
 """Common code for listing files from a bup repository."""
 
 """Common code for listing files from a bup repository."""
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 from itertools import chain
 from stat import S_ISDIR, S_ISLNK
 from itertools import chain
 from stat import S_ISDIR, S_ISLNK
-import copy, locale, os.path, stat, sys, xstat
+import copy, locale, os.path, stat, sys
 
 
-from bup import metadata, options, vfs
+from bup import metadata, options, vfs, xstat
 from bup.options import Options
 from bup.repo import LocalRepo, RemoteRepo
 from bup.options import Options
 from bup.repo import LocalRepo, RemoteRepo
-from helpers import columnate, istty1, last, log
+from bup.helpers import columnate, istty1, last, log
 
 def item_hash(item, tree_for_commit):
     """If the item is a Commit, return its commit oid, otherwise return
 
 def item_hash(item, tree_for_commit):
     """If the item is a Commit, return its commit oid, otherwise return
index 8ceebdcc09ad8a4e14eed6b57714795d4722e2c0..e5337c96278563663a1d0c61303df8cbe8d5e162 100644 (file)
@@ -5,6 +5,7 @@
 # This code is covered under the terms of the GNU Library General
 # Public License as described in the bup LICENSE file.
 
 # This code is covered under the terms of the GNU Library General
 # Public License as described in the bup LICENSE file.
 
+from __future__ import absolute_import
 from copy import deepcopy
 from errno import EACCES, EINVAL, ENOTTY, ENOSYS, EOPNOTSUPP
 from io import BytesIO
 from copy import deepcopy
 from errno import EACCES, EINVAL, ENOTTY, ENOSYS, EOPNOTSUPP
 from io import BytesIO
index a4ef37b21cbaa792aa622d9bdd109ce5f3434498..a24b104a5abf943c193b651c835df52f99b3860b 100644 (file)
@@ -1,4 +1,5 @@
 
 
+from __future__ import absolute_import
 import glob, mmap, os, struct
 
 from bup import _helpers
 import glob, mmap, os, struct
 
 from bup import _helpers
index b4b5282b9cc58d16929f2ce54b34125ec867f2a7..394b71daed2311e9417cd97353e9b12975b7b288 100644 (file)
@@ -60,6 +60,8 @@ Options can be put in different groups. Options in the same group must be on
 consecutive lines. Groups are formed by inserting a line that begins with a
 space. The text on that line will be output after an empty line.
 """
 consecutive lines. Groups are formed by inserting a line that begins with a
 space. The text on that line will be output after an empty line.
 """
+
+from __future__ import absolute_import
 import sys, os, textwrap, getopt, re, struct
 
 try:
 import sys, os, textwrap, getopt, re, struct
 
 try:
index 820c78b8eb4c73745c010e6088567e9599acd10a..9b9445eb65ada6260b4f1723944c936113fa1088 100644 (file)
@@ -1,6 +1,8 @@
 """This is a separate module so we can cleanly getcwd() before anyone
    does chdir().
 """
 """This is a separate module so we can cleanly getcwd() before anyone
    does chdir().
 """
+
+from __future__ import absolute_import
 import sys, os
 
 startdir = os.getcwd()
 import sys, os
 
 startdir = os.getcwd()
index 25a94b0f66f9cb04765abf1f11436a4d1ceff3f2..ca092192e64c3719ecc6760b425b3638b2697386 100644 (file)
@@ -1,4 +1,5 @@
 
 
+from __future__ import absolute_import
 from functools import partial
 
 from bup import client, git
 from functools import partial
 
 from bup import client, git
index 453de343cfb7baf3033eda4388697f96ddb0935c..5345114289eaea8c7b3945f38eccc4d2a7fe2aad 100644 (file)
@@ -1,4 +1,5 @@
 
 
+from __future__ import absolute_import
 import sys
 
 from bup import compat, git, vfs
 import sys
 
 from bup import compat, git, vfs
index a3cd4c4846114d17be481a398b92a84abf047c6c..d7e451aa45fe007859cab765ebd0af752cc58470 100644 (file)
@@ -1,3 +1,5 @@
+
+from __future__ import absolute_import
 import re
 
 q = "'"
 import re
 
 q = "'"
index 34b5f3c38a2c30740d97dd097a9906c1a8e00f5f..97ab3121a7177b9a0e0f24f4b39e795767e9fe8f 100644 (file)
@@ -1,6 +1,8 @@
 """SSH connection.
 Connect to a remote host via SSH and execute a command on the host.
 """
 """SSH connection.
 Connect to a remote host via SSH and execute a command on the host.
 """
+
+from __future__ import absolute_import
 import sys, os, re, subprocess
 from bup import helpers, path
 
 import sys, os, re, subprocess
 from bup import helpers, path
 
index 172f0405b1c6b25fc44acc7254be70e67b3807fb..580ba1927461d9435634c0aa3b03fbbfa6cf2e6a 100644 (file)
@@ -1,2 +1,5 @@
+
+from __future__ import absolute_import
 import sys
 import sys
+
 sys.path[:0] = ['../..']
 sys.path[:0] = ['../..']
index f47f4827248ba1102058ee0b084c3717fc1df2e2..2f17046eb002bab12b17049870dd4da775f99517 100644 (file)
@@ -1,4 +1,5 @@
 
 
+from __future__ import absolute_import
 import errno, platform, tempfile
 
 from wvtest import *
 import errno, platform, tempfile
 
 from wvtest import *
index 4a3147cf3833217c64fa40b7494bc7832f33f811..8a810e9a50bd2e24d693d62a8dbd0b203cf965bf 100644 (file)
@@ -1,4 +1,5 @@
 
 
+from __future__ import absolute_import
 import sys, os, stat, time, random, subprocess, glob
 
 from wvtest import *
 import sys, os, stat, time, random, subprocess, glob
 
 from wvtest import *
index 3d2e903f9337159136e5d7c633a03ab3ac5afe3e..dc49330c43766dd61c52327559c8badf51e5246f 100644 (file)
@@ -1,4 +1,5 @@
 
 
+from __future__ import absolute_import
 from subprocess import check_call
 import struct, os, time
 
 from subprocess import check_call
 import struct, os, time
 
index 1a95f4052d543c54e8d49f0acd00ff140bb5a3fc..5b995860442c16521c523216c7023f0f8efbf8c3 100644 (file)
@@ -1,3 +1,5 @@
+
+from __future__ import absolute_import
 from io import BytesIO
 
 from wvtest import *
 from io import BytesIO
 
 from wvtest import *
index c707839fdb956ce7a6dfdb50ff27510479fbd53e..e0ef21fd5098c25963b55ef7eb1858b99ac6d084 100644 (file)
@@ -1,4 +1,5 @@
 
 
+from __future__ import absolute_import
 import helpers, math, os, os.path, stat, subprocess
 
 from wvtest import *
 import helpers, math, os, os.path, stat, subprocess
 
 from wvtest import *
index 6639e0b939fcd5f7584c15efaebf42055d6b4353..6364d9e8b25be55fe1cc177dba6cead67527dea9 100644 (file)
@@ -1,4 +1,5 @@
 
 
+from __future__ import absolute_import
 import os, time
 
 from wvtest import *
 import os, time
 
 from wvtest import *
index 5caaa469b027c13cea395f25d0f6aecb59744590..91cb6df550c2e63e1631bfea4f3700ff0411c31b 100644 (file)
@@ -1,4 +1,5 @@
 
 
+from __future__ import absolute_import
 import errno, glob, grp, pwd, stat, tempfile, subprocess
 
 from wvtest import *
 import errno, glob, grp, pwd, stat, tempfile, subprocess
 
 from wvtest import *
index 5b4a6aaab32e35ce5d8e0bd78aedfe5f0d46a9c1..1b60554b19f4695af381fd1a1a949a25f0a82d6a 100644 (file)
@@ -1,8 +1,9 @@
 
 
-from bup import options
+from __future__ import absolute_import
 
 from wvtest import *
 
 
 from wvtest import *
 
+from bup import options
 from buptest import no_lingering_errors
 
 
 from buptest import no_lingering_errors
 
 
index 195cc58170ad418d804ca961cf0c6296bcfc2b81..f17346df40d7b0286560a406aebdae09aba3e373 100644 (file)
@@ -1,4 +1,6 @@
 
 
+from __future__ import absolute_import
+
 from wvtest import *
 
 from bup import shquote
 from wvtest import *
 
 from bup import shquote
index a8a9be447a77866e9b00d2fc205354eadd75e887..0af42fbb784745088d7f6f510888f8914ecf75c1 100644 (file)
@@ -1,5 +1,5 @@
 
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 from collections import namedtuple
 from errno import ELOOP, ENOTDIR
 from io import BytesIO
 from collections import namedtuple
 from errno import ELOOP, ENOTDIR
 from io import BytesIO
index 283e179f51af2d56b65e40e26e578833279f068d..51cd91ee63852034ce36655d1687b45e49162f52 100644 (file)
@@ -1,3 +1,5 @@
+
+from __future__ import absolute_import
 from io import BytesIO
 
 from wvtest import *
 from io import BytesIO
 
 from wvtest import *
index 33d4341649d7b35e366418aef8cd63470596d832..64bad2de0eed71d0e8776dabe1831e5e1e9d3247 100644 (file)
@@ -1,3 +1,5 @@
+
+from __future__ import absolute_import
 import math, tempfile, subprocess
 
 from wvtest import *
 import math, tempfile, subprocess
 
 from wvtest import *
index 23d3921058ca18caa1a44eacc37a3fac27c61977..fe66a91a5ea9431e8e7d0751ea53fbe243f5c906 100644 (file)
@@ -1,4 +1,6 @@
 
 
+from __future__ import absolute_import
+
 from bup import _release
 
 if _release.COMMIT != '$Format:%H$':
 from bup import _release
 
 if _release.COMMIT != '$Format:%H$':
index a147ff94add8a2fe81b55e530b509c072f2edd3b..d073b7374654c7d3cd9a1031a9703fce4b19b835 100644 (file)
@@ -45,7 +45,7 @@ item.coid.
 
 """
 
 
 """
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 from collections import namedtuple
 from errno import ELOOP, ENOENT, ENOTDIR
 from itertools import chain, dropwhile, groupby, izip, tee
 from collections import namedtuple
 from errno import ELOOP, ENOENT, ENOTDIR
 from itertools import chain, dropwhile, groupby, izip, tee
index 378234c62d2a2a5ec1f2ed9b62598a132e8dd07d..70c2dce5931f1bed584bbb8ba7d29e722485145d 100644 (file)
@@ -5,6 +5,7 @@
 # This code is covered under the terms of the GNU Library General
 # Public License as described in the bup LICENSE file.
 
 # This code is covered under the terms of the GNU Library General
 # Public License as described in the bup LICENSE file.
 
+from __future__ import absolute_import
 from io import BytesIO
 
 # Variable length integers are encoded as vints -- see jakarta lucene.
 from io import BytesIO
 
 # Variable length integers are encoded as vints -- see jakarta lucene.
index f4e5b04659770d10fbb8b831615274018fb6e2fb..077020213f4378b6d816b3315cace6f78f05c043 100644 (file)
@@ -1,4 +1,6 @@
 """Enhanced stat operations for bup."""
 """Enhanced stat operations for bup."""
+
+from __future__ import absolute_import
 import os, sys
 import stat as pystat
 from bup import _helpers
 import os, sys
 import stat as pystat
 from bup import _helpers
diff --git a/main.py b/main.py
index dc1bec28690015fceaf127ec27af29ce56767748..edb3ed88fa4196cafa26e81be957d08c634684fd 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
 import errno, re, sys, os, subprocess, signal, getopt
 
 from fcntl import F_GETFL, F_SETFL
 import errno, re, sys, os, subprocess, signal, getopt
 
 from fcntl import F_GETFL, F_SETFL
@@ -35,7 +36,7 @@ os.environ['BUP_MAIN_EXE'] = os.path.abspath(exe)
 os.environ['BUP_RESOURCE_PATH'] = resourcepath
 
 
 os.environ['BUP_RESOURCE_PATH'] = resourcepath
 
 
-from bup import helpers
+from bup import compat, helpers
 from bup.compat import add_ex_tb, chain_ex, wrap_main
 from bup.helpers import atoi, columnate, debug1, log, tty_width
 
 from bup.compat import add_ex_tb, chain_ex, wrap_main
 from bup.helpers import atoi, columnate, debug1, log, tty_width
 
index d7da54560aee47aac9f03f34c9edaedfab447e10..0c7a4f9bbf14224c80e7321c4dd5a626fa990e0d 100755 (executable)
@@ -5,6 +5,8 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
+
 from os.path import getsize, isdir
 from sys import argv, stderr
 import os
 from os.path import getsize, isdir
 from sys import argv, stderr
 import os
index 9dffe1410060be110e55a11a77b122ad190863bc..99ab88386c4dee604f6009faf9dd0a7b684099a3 100755 (executable)
@@ -5,6 +5,8 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
+
 import os, stat, sys
 
 # Print the full paths of all the files in each hardlink set
 import os, stat, sys
 
 # Print the full paths of all the files in each hardlink set
index 2c0370f3697afce22c61bdfeea473b09e6d2a5c6..eb6aead51281c1f52302fe1931d3a3f8a3514877 100755 (executable)
@@ -5,6 +5,8 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
+
 import grp
 import pwd
 import sys
 import grp
 import pwd
 import sys
index 6fb19d8c3fad4bdaa19e78bec4aae362167156c9..3a580db3350fb385b3b5976f307ee88714d4cdf4 100755 (executable)
--- a/t/mksock
+++ b/t/mksock
@@ -5,6 +5,8 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
+
 import socket, sys
 
 s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
 import socket, sys
 
 s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
index 07631276c1e441e58b28bb2e704ed87073a3d048..9927bd57ef9e4e7be51d1217d02ff8a127c0bd49 100755 (executable)
@@ -5,6 +5,8 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
+
 import os, sys
 
 argv = sys.argv
 import os, sys
 
 argv = sys.argv
index 0c43e9d38b88f21e094b4c25f0cd700ece48758a..28e2347357b6a0bc1a9ff7e595a3c9f869b10c04 100755 (executable)
@@ -5,7 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 from sys import stderr
 import sys
 
 from sys import stderr
 import sys
 
index 926303f4f2acb30c1e3af03d49d3d20abc2342c9..9d0fca6b1783ac2867c9acab41a92670166f8cfd 100755 (executable)
@@ -5,6 +5,8 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
+
 import os, sys
 
 argv = sys.argv
 import os, sys
 
 argv = sys.argv
index 62c81c150c8b92afcf363703df47627ff488c231..9431f14f6ad826d7fa1f3c4a473afc3045acb048 100755 (executable)
@@ -5,7 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 from os import environ, chdir, mkdir, symlink, unlink
 from os.path import abspath, dirname
 from time import localtime, strftime
 from os import environ, chdir, mkdir, symlink, unlink
 from os.path import abspath, dirname
 from time import localtime, strftime
index 2ec59474c170fe49b2475a9e8352d610739c6eb6..95a26700434784755f638668c613c987e8eb1bdf 100755 (executable)
@@ -5,7 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 from collections import defaultdict
 from difflib import unified_diff
 from itertools import chain, dropwhile, groupby, takewhile
 from collections import defaultdict
 from difflib import unified_diff
 from itertools import chain, dropwhile, groupby, takewhile
index 210c5b3fe41350f3edaae673fb5b241bd5347127..9ec7e4492545665ec8b7444630d1ff1cca0cfad0 100755 (executable)
@@ -5,6 +5,8 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import absolute_import
+
 import grp
 import pwd
 import sys
 import grp
 import pwd
 import sys
index 742534fe25b01030c1f58c8a02b06361126f496e..2f48ef62acfa56a4cfdd850095f7d76b4c54ea29 100755 (executable)
--- a/wvtest.py
+++ b/wvtest.py
@@ -4,6 +4,7 @@ bup_python="$(dirname "$0")/cmd/bup-python"
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 #
 # WvTest:
 #   Copyright (C)2007-2012 Versabanq Innovations Inc. and contributors.
 #
 # WvTest:
 #   Copyright (C)2007-2012 Versabanq Innovations Inc. and contributors.
@@ -11,6 +12,8 @@ exec "$bup_python" "$0" ${1+"$@"}
 #       See the included file named LICENSE for license information.
 #       You can get wvtest from: http://github.com/apenwarr/wvtest
 #
 #       See the included file named LICENSE for license information.
 #       You can get wvtest from: http://github.com/apenwarr/wvtest
 #
+
+from __future__ import absolute_import
 import atexit
 import inspect
 import os
 import atexit
 import inspect
 import os