From 5e6bb8283543c3eec2535e09cc90673e9f1fbae1 Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 6 Sep 2018 21:25:20 -0700 Subject: [PATCH 01/15] Add minor documentation fixes. --- CHANGES.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 68d058e..568a722 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,5 @@ ## Summary of release changes, see commit history for more details: -## https://github.com/joelthelion/autojump/commits/master/ +## https://github.com/wting/autojump/commits/master/ ### Release v22.4.0: - minor zsh performance improvement diff --git a/README.md b/README.md index 15970e1..96b6e86 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ autojump is included in the following distro repositories, please use relevant package management utilities to install (e.g. yum, apt-get, etc): -- Debian testing/unstable, Ubuntu, Linux Mint +- Debian, Ubuntu, Linux Mint All Debian-derived distros require manual activation for policy reasons, please see `/usr/share/doc/autojump/README.Debian`. From b4e8474769b1677af1761e3621d29bbb815b0490 Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 6 Sep 2018 21:25:39 -0700 Subject: [PATCH 02/15] Add trailing comma precommit hook and bump old ones. --- .pre-commit-config.yaml | 87 ++++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 35 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 93f076b..c9d7a9d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,35 +1,52 @@ -- repo: git@github.com:pre-commit/pre-commit-hooks.git - sha: v0.9.1 - hooks: - - id: autopep8-wrapper - args: - - --in-place - - --aggressive - - --aggressive - - --max-line-length=131 - - --ignore=E126,E128,E402,E731 - - id: check-added-large-files - - id: check-ast - - id: check-case-conflict - - id: check-docstring-first - - id: debug-statements - - id: double-quote-string-fixer - - id: end-of-file-fixer - - id: fix-encoding-pragma - - id: flake8 - args: - - --max-complexity=10 - - --max-line-length=131 - - --ignore=E126,E128,E402,E731 - - --exclude=bin/autojump_argparse.py - - id: requirements-txt-fixer - - id: trailing-whitespace -- repo: git@github.com:asottile/reorder_python_imports.git - sha: v0.3.5 - hooks: - - id: reorder-python-imports - language_version: python2.7 -- repo: https://github.com/asottile/add-trailing-comma - sha: v0.6.1 - hooks: - - id: add-trailing-comma +repos: +- repo: git@github.com:pre-commit/pre-commit-hooks.git + rev: v1.4.0 + hooks: + - id: autopep8-wrapper + language_version: python2 + args: + - --in-place + - --aggressive + - --aggressive + - --ignore=E731 + - --max-line-length=131 + - id: check-added-large-files + language_version: python2 + - id: check-ast + language_version: python2 + - id: check-case-conflict + language_version: python2 + - id: check-docstring-first + language_version: python2 + - id: debug-statements + language_version: python2 + - id: double-quote-string-fixer + language_version: python2 + - id: end-of-file-fixer + language_version: python2 + - id: fix-encoding-pragma + language_version: python2 + - id: flake8 + language_version: python2 + args: + - --max-complexity=10 + - --max-line-length=131 + - --ignore=E126 + - --ignore=E128 + - --ignore=E731 + - --exclude=bin/autojump_argparse.py + - id: name-tests-test + language_version: python2 + - id: requirements-txt-fixer + language_version: python2 + - id: trailing-whitespace + language_version: python2 +- repo: git@github.com:asottile/reorder_python_imports.git + rev: v1.1.1 + hooks: + - id: reorder-python-imports + language_version: python2 +- repo: git@github.com:asottile/add-trailing-comma + rev: v0.7.0 + hooks: + - id: add-trailing-comma From 4f84e755f5c94c052fca52947bee4b78ff6154d0 Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 6 Sep 2018 21:28:05 -0700 Subject: [PATCH 03/15] Add 'make lint' target. --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2e8da45..9d3ca0c 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,15 @@ VERSION = $(shell grep -oE "[0-9]+\.[0-9]+\.[0-9]+" bin/autojump) TAGNAME = release-v$(VERSION) -.PHONY: clean docs install uninstall pre-commit lint tar test - +.PHONY: install install: ./install.py +.PHONY: uninstall uninstall: ./uninstall.py +.PHONY: docs docs: pandoc -s -w man docs/manpage_header.md docs/header.md docs/body.md -o docs/autojump.1 pandoc -s -w markdown docs/header.md docs/install.md docs/body.md -o README.md @@ -17,9 +18,11 @@ docs: lint: pre-commit @tox -e pre-commit -- run --all-files +.PHONY: pre-commit pre-commit: @tox -e pre-commit -- install -f --install-hooks +.PHONY: release release: docs # Check for tag existence # git describe release-$(VERSION) 2>&1 >/dev/null || exit 1 @@ -37,20 +40,25 @@ release: docs git archive --format=tar --prefix autojump_v$(VERSION)/ $(TAGNAME) | gzip > autojump_v$(VERSION).tar.gz sha1sum autojump_v$(VERSION).tar.gz +.PHONY: tar tar: # Create tagged archive git archive --format=tar --prefix autojump_v$(VERSION)/ $(TAGNAME) | gzip > autojump_v$(VERSION).tar.gz sha1sum autojump_v$(VERSION).tar.gz +.PHONY: test test: pre-commit @tox +.PHONY: test-xfail test-xfail: pre-commit @tox -- --runxfail +.PHONY: test-fast test-fast: pre-commit @tox -e py27 +.PHONY: clean clean: @find . -type f -iname '*.py[co]' -delete @find . -type d -iname '__pycache__' -delete From 7494d142d5fcc38a2b6a96470448a8f06f51a66a Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 6 Sep 2018 21:40:51 -0700 Subject: [PATCH 04/15] Ignore .pytest_cache/ --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f38419e..c954632 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ __pycache__ *~ *.tar.gz *.patch +.pytest_cache .tox tags From 5ab005ea86b2b770e031a36720beb5a23cff324e Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 6 Sep 2018 22:03:20 -0700 Subject: [PATCH 05/15] Don't change EOF line endings for files used on Windows. --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c9d7a9d..8f99758 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,6 +24,7 @@ repos: language_version: python2 - id: end-of-file-fixer language_version: python2 + exclude_types: [batch, lua] - id: fix-encoding-pragma language_version: python2 - id: flake8 From 965296f6b26a97b47a20d8b2019a0849166c1d26 Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 6 Sep 2018 22:15:05 -0700 Subject: [PATCH 06/15] Fix flake8 ignore option. --- .pre-commit-config.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f99758..9a1ed84 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,9 +32,7 @@ repos: args: - --max-complexity=10 - --max-line-length=131 - - --ignore=E126 - - --ignore=E128 - - --ignore=E731 + - --ignore=E402,E731 - --exclude=bin/autojump_argparse.py - id: name-tests-test language_version: python2 From fc43204ca174c20a91ed535a5dbd8d74b25fbd24 Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 6 Sep 2018 22:32:23 -0700 Subject: [PATCH 07/15] Run pre-commit hooks. --- bin/autojump_argparse.py | 49 +++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/bin/autojump_argparse.py b/bin/autojump_argparse.py index 950db4d..bb14666 100644 --- a/bin/autojump_argparse.py +++ b/bin/autojump_argparse.py @@ -311,9 +311,11 @@ class HelpFormatter(object): return help def _join_parts(self, part_strings): - return ''.join([part - for part in part_strings - if part and part is not SUPPRESS]) + return ''.join([ + part + for part in part_strings + if part and part is not SUPPRESS + ]) def _format_usage(self, usage, actions, groups, prefix): if prefix is None: @@ -1526,9 +1528,11 @@ class _ActionsContainer(object): def _handle_conflict_error(self, action, conflicting_actions): message = _('conflicting option string(s): %s') - conflict_string = ', '.join([option_string - for option_string, action - in conflicting_actions]) + conflict_string = ', '.join([ + option_string + for option_string, action + in conflicting_actions + ]) raise ArgumentError(action, message % conflict_string) def _handle_conflict_resolve(self, action, conflicting_actions): @@ -1760,14 +1764,18 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): return action def _get_optional_actions(self): - return [action - for action in self._actions - if action.option_strings] + return [ + action + for action in self._actions + if action.option_strings + ] def _get_positional_actions(self): - return [action - for action in self._actions - if not action.option_strings] + return [ + action + for action in self._actions + if not action.option_strings + ] # ===================================== # Command line argument parsing methods @@ -1991,7 +1999,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): next_option_string_index = min([ index for index in option_string_indices - if index >= start_index]) + if index >= start_index + ]) if start_index != next_option_string_index: positionals_end_index = consume_positionals(start_index) @@ -2040,9 +2049,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): # if no actions were used, report the error else: - names = [_get_action_name(action) - for action in group._group_actions - if action.help is not SUPPRESS] + names = [ + _get_action_name(action) + for action in group._group_actions + if action.help is not SUPPRESS + ] msg = _('one of the arguments %s is required') self.error(msg % ' '.join(names)) @@ -2106,8 +2117,10 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): result = [] for i in range(len(actions), 0, -1): actions_slice = actions[:i] - pattern = ''.join([self._get_nargs_pattern(action) - for action in actions_slice]) + pattern = ''.join([ + self._get_nargs_pattern(action) + for action in actions_slice + ]) match = _re.match(pattern, arg_strings_pattern) if match is not None: result.extend([len(string) for string in match.groups()]) From 0cbfd764f55b862d11659b0d554dda48ca05d2bb Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 6 Sep 2018 22:50:30 -0700 Subject: [PATCH 08/15] Automatically update manpage header when generating docs. --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 9d3ca0c..c0c828c 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ uninstall: .PHONY: docs docs: + @echo "% autojump(1) ${TAGNAME}" >docs/manpage_header.md + @echo "%" >>docs/manpage_header.md + @echo "% $(shell \date +%Y-%m-%d)" >>docs/manpage_header.md pandoc -s -w man docs/manpage_header.md docs/header.md docs/body.md -o docs/autojump.1 pandoc -s -w markdown docs/header.md docs/install.md docs/body.md -o README.md From 89eb573306c76e6eeda3e683e87a394714b2c56a Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 6 Sep 2018 22:53:18 -0700 Subject: [PATCH 09/15] Update docs. --- README.md | 2 +- docs/autojump.1 | 4 ++-- docs/body.md | 2 +- docs/install.md | 2 +- docs/manpage_header.md | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 96b6e86..b61f879 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ which should be installed prior to installing autojump. Grab a copy of autojump: - git clone git://github.com/joelthelion/autojump.git + git clone git://github.com/wting/autojump.git Run the installation script and follow on screen instructions. diff --git a/docs/autojump.1 b/docs/autojump.1 index 98e0d44..40af970 100644 --- a/docs/autojump.1 +++ b/docs/autojump.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 1.16.0.2 .\" -.TH "autojump" "1" "10 April 2012" "release\-v22" "" +.TH "autojump" "1" "2018\-09\-06" "release\-v22.5.1" "" .hy .SS NAME .PP @@ -120,7 +120,7 @@ For any questions or issues please visit: .IP .nf \f[C] -https://github.com/joelthelion/autojump/issues +https://github.com/wting/autojump/issues \f[] .fi .SS AUTHORS diff --git a/docs/body.md b/docs/body.md index 91a169e..dc79b7d 100644 --- a/docs/body.md +++ b/docs/body.md @@ -17,7 +17,7 @@ REPORTING BUGS For any questions or issues please visit: - https://github.com/joelthelion/autojump/issues + https://github.com/wting/autojump/issues AUTHORS ------- diff --git a/docs/install.md b/docs/install.md index 2a2604b..2b323b2 100644 --- a/docs/install.md +++ b/docs/install.md @@ -48,7 +48,7 @@ should be installed prior to installing autojump. Grab a copy of autojump: - git clone git://github.com/joelthelion/autojump.git + git clone git://github.com/wting/autojump.git Run the installation script and follow on screen instructions. diff --git a/docs/manpage_header.md b/docs/manpage_header.md index 14e1938..7765d4a 100644 --- a/docs/manpage_header.md +++ b/docs/manpage_header.md @@ -1,3 +1,3 @@ -% autojump(1) release-v22 +% autojump(1) release-v22.5.1 % -% 10 April 2012 +% 2018-09-06 From 26c81fc39fa538bbd0380ee0b65c6b921974f084 Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 6 Sep 2018 22:59:27 -0700 Subject: [PATCH 10/15] Clarify supported Python versions. --- README.md | 2 +- docs/install.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b61f879..6e838b9 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ INSTALLATION ### REQUIREMENTS -- Python v2.6+ except v3.2 +- Python v2.6+ or Python 3.3+ - Supported shells: - bash v4.0+ - zsh diff --git a/docs/install.md b/docs/install.md index 2b323b2..0d0aac9 100644 --- a/docs/install.md +++ b/docs/install.md @@ -2,7 +2,7 @@ ### REQUIREMENTS -- Python v2.6+ except v3.2 +- Python v2.6+ or Python 3.3+ - Supported shells: - bash v4.0+ - zsh From 8eace445a7206e3bce25b04812be0561bd9b7c28 Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 6 Sep 2018 23:13:58 -0700 Subject: [PATCH 11/15] Clarify between first class and community supported items. --- README.md | 103 +++++++++++++++++++++++++++++------------------- docs/install.md | 98 +++++++++++++++++++++++++++------------------ 2 files changed, 121 insertions(+), 80 deletions(-) diff --git a/README.md b/README.md index 6e838b9..495226a 100644 --- a/README.md +++ b/README.md @@ -63,49 +63,32 @@ INSTALLATION ### REQUIREMENTS -- Python v2.6+ or Python 3.3+ -- Supported shells: - - bash v4.0+ - - zsh - - fish - - tcsh (experimental) - - clink (Windows, experimental) +- Python v2.6+ or Python v3.3+ +- Supported shells + - bash - first class support + - zsh - first class support + - fish - community supported + - tcsh - community supported + - clink - community supported +- Supported platforms + - Linux - first class support + - OS X - first class support + - Windows - community supported + - BSD - community supported +- Supported installation methods + - source code - first class support + - Debian and derivatives - first class support + - ArchLinux / Gentoo / openSUSE / RedHat and derivatives - + community supported + - Homebrew / MacPorts - community supported -### AUTOMATIC +Due to limited time and resources, only "first class support" items will +be maintained by the primary committers. All "community supported" items +will be updated based on pull requests submitted by the general public. -#### Linux - -autojump is included in the following distro repositories, please use -relevant package management utilities to install (e.g. yum, apt-get, -etc): - -- Debian, Ubuntu, Linux Mint - - All Debian-derived distros require manual activation for policy - reasons, please see `/usr/share/doc/autojump/README.Debian`. - -- RedHat, Fedora, CentOS (install `autojump-zsh` for zsh, - `autojump-fish` for fish, etc.) -- ArchLinux -- Gentoo -- Frugalware -- Slackware - -#### OS X - -Homebrew is the recommended installation method for Mac OS X: - - brew install autojump - -MacPorts also available: - - port install autojump - -Windows -------- - -Windows support is enabled by [clink](https://mridgers.github.io/clink/) -which should be installed prior to installing autojump. +Please continue opening issues and providing feedback for community +supported items since consolidating information helps other users +troubleshoot and submit enhancements and fixes. ### MANUAL @@ -118,6 +101,44 @@ Run the installation script and follow on screen instructions. cd autojump ./install.py or ./uninstall.py +### AUTOMATIC + +#### Linux + +autojump is included in the following distro repositories, please use +relevant package management utilities to install (e.g. apt-get, yum, +pacman, etc): + +- Debian, Ubuntu, Linux Mint + + All Debian-derived distros require manual activation for policy + reasons, please see `/usr/share/doc/autojump/README.Debian`. + +- RedHat, Fedora, CentOS + + Install `autojump-zsh` for zsh, `autojump-fish` for fish, etc. + +- ArchLinux +- Gentoo +- Frugalware +- Slackware + +#### OS X + +Homebrew is the recommended installation method for Mac OS X: + + brew install autojump + +MacPorts is also available: + + port install autojump + +Windows +------- + +Windows support is enabled by [clink](https://mridgers.github.io/clink/) +which should be installed prior to installing autojump. + KNOWN ISSUES ------------ diff --git a/docs/install.md b/docs/install.md index 0d0aac9..d4e4867 100644 --- a/docs/install.md +++ b/docs/install.md @@ -2,47 +2,31 @@ ### REQUIREMENTS -- Python v2.6+ or Python 3.3+ -- Supported shells: - - bash v4.0+ - - zsh - - fish - - tcsh (experimental) - - clink (Windows, experimental) +- Python v2.6+ or Python v3.3+ +- Supported shells + - bash - first class support + - zsh - first class support + - fish - community supported + - tcsh - community supported + - clink - community supported +- Supported platforms + - Linux - first class support + - OS X - first class support + - Windows - community supported + - BSD - community supported +- Supported installation methods + - source code - first class support + - Debian and derivatives - first class support + - ArchLinux / Gentoo / openSUSE / RedHat and derivatives - community supported + - Homebrew / MacPorts - community supported -### AUTOMATIC +Due to limited time and resources, only "first class support" items will be +maintained by the primary committers. All "community supported" items will be +updated based on pull requests submitted by the general public. -#### Linux - -autojump is included in the following distro repositories, please use relevant -package management utilities to install (e.g. yum, apt-get, etc): - -- Debian, Ubuntu, Linux Mint - - All Debian-derived distros require manual activation for policy reasons, - please see `/usr/share/doc/autojump/README.Debian`. - -- RedHat, Fedora, CentOS (install `autojump-zsh` for zsh, `autojump-fish` for - fish, etc.) -- ArchLinux -- Gentoo -- Frugalware -- Slackware - -#### OS X - -Homebrew is the recommended installation method for Mac OS X: - - brew install autojump - -MacPorts also available: - - port install autojump - -## Windows - -Windows support is enabled by [clink](https://mridgers.github.io/clink/) which -should be installed prior to installing autojump. +Please continue opening issues and providing feedback for community supported +items since consolidating information helps other users troubleshoot and submit +enhancements and fixes. ### MANUAL @@ -54,3 +38,39 @@ Run the installation script and follow on screen instructions. cd autojump ./install.py or ./uninstall.py + +### AUTOMATIC + +#### Linux + +autojump is included in the following distro repositories, please use relevant +package management utilities to install (e.g. apt-get, yum, pacman, etc): + +- Debian, Ubuntu, Linux Mint + + All Debian-derived distros require manual activation for policy reasons, + please see `/usr/share/doc/autojump/README.Debian`. + +- RedHat, Fedora, CentOS + + Install `autojump-zsh` for zsh, `autojump-fish` for fish, etc. + +- ArchLinux +- Gentoo +- Frugalware +- Slackware + +#### OS X + +Homebrew is the recommended installation method for Mac OS X: + + brew install autojump + +MacPorts is also available: + + port install autojump + +## Windows + +Windows support is enabled by [clink](https://mridgers.github.io/clink/) which +should be installed prior to installing autojump. From bc4ea615462adb15ce53de94a09cec30bcc5dc0a Mon Sep 17 00:00:00 2001 From: William Ting Date: Fri, 7 Sep 2018 14:28:09 -0700 Subject: [PATCH 12/15] Create temporary file on the same device as data. One idea for why the database is occasionally purged is due to the temporary file being on a separate device than the database. This patch implements @lilydjwg's suggestion here: https://github.com/wting/autojump/issues/391#issuecomment-419349650 --- bin/autojump | 2 +- bin/autojump_data.py | 5 +++-- docs/autojump.1 | 2 +- docs/manpage_header.md | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/autojump b/bin/autojump index e7b061d..9593ead 100755 --- a/bin/autojump +++ b/bin/autojump @@ -65,7 +65,7 @@ from autojump_utils import sanitize from autojump_utils import take from autojump_utils import unico -VERSION = '22.5.1' +VERSION = '22.5.2' FUZZY_MATCH_THRESHOLD = 0.6 TAB_ENTRIES_COUNT = 9 TAB_SEPARATOR = '__' diff --git a/bin/autojump_data.py b/bin/autojump_data.py index 2ba7fbb..d647a42 100644 --- a/bin/autojump_data.py +++ b/bin/autojump_data.py @@ -120,11 +120,12 @@ def migrate_osx_xdg_data(config): def save(config, data): """Save data and create backup, creating a new data file if necessary.""" - create_dir(os.path.dirname(config['data_path'])) + data_dir = os.path.dirname(config['data_path']) + create_dir(data_dir) # atomically save by writing to temporary file and moving to destination try: - temp = NamedTemporaryFile(delete=False) + temp = NamedTemporaryFile(delete=False, dir=data_dir) # Windows cannot reuse the same open file name temp.close() diff --git a/docs/autojump.1 b/docs/autojump.1 index 40af970..af585ee 100644 --- a/docs/autojump.1 +++ b/docs/autojump.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 1.16.0.2 .\" -.TH "autojump" "1" "2018\-09\-06" "release\-v22.5.1" "" +.TH "autojump" "1" "2018\-09\-07" "release\-v22.5.2" "" .hy .SS NAME .PP diff --git a/docs/manpage_header.md b/docs/manpage_header.md index 7765d4a..e01f03e 100644 --- a/docs/manpage_header.md +++ b/docs/manpage_header.md @@ -1,3 +1,3 @@ -% autojump(1) release-v22.5.1 +% autojump(1) release-v22.5.2 % -% 2018-09-06 +% 2018-09-07 From daa496bc3933cca6236e66f7b6cd9632817e2bf4 Mon Sep 17 00:00:00 2001 From: William Ting Date: Sun, 9 Sep 2018 09:52:53 -0700 Subject: [PATCH 13/15] Revert "Merge branch 'wting_create_temp_file_on_same_device'" This reverts commit cf358d8fd398841764006dc5dbe0daeebecac572, reversing changes made to 8eace445a7206e3bce25b04812be0561bd9b7c28. --- bin/autojump | 2 +- bin/autojump_data.py | 5 ++--- docs/autojump.1 | 2 +- docs/manpage_header.md | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/autojump b/bin/autojump index 9593ead..e7b061d 100755 --- a/bin/autojump +++ b/bin/autojump @@ -65,7 +65,7 @@ from autojump_utils import sanitize from autojump_utils import take from autojump_utils import unico -VERSION = '22.5.2' +VERSION = '22.5.1' FUZZY_MATCH_THRESHOLD = 0.6 TAB_ENTRIES_COUNT = 9 TAB_SEPARATOR = '__' diff --git a/bin/autojump_data.py b/bin/autojump_data.py index d647a42..2ba7fbb 100644 --- a/bin/autojump_data.py +++ b/bin/autojump_data.py @@ -120,12 +120,11 @@ def migrate_osx_xdg_data(config): def save(config, data): """Save data and create backup, creating a new data file if necessary.""" - data_dir = os.path.dirname(config['data_path']) - create_dir(data_dir) + create_dir(os.path.dirname(config['data_path'])) # atomically save by writing to temporary file and moving to destination try: - temp = NamedTemporaryFile(delete=False, dir=data_dir) + temp = NamedTemporaryFile(delete=False) # Windows cannot reuse the same open file name temp.close() diff --git a/docs/autojump.1 b/docs/autojump.1 index af585ee..40af970 100644 --- a/docs/autojump.1 +++ b/docs/autojump.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 1.16.0.2 .\" -.TH "autojump" "1" "2018\-09\-07" "release\-v22.5.2" "" +.TH "autojump" "1" "2018\-09\-06" "release\-v22.5.1" "" .hy .SS NAME .PP diff --git a/docs/manpage_header.md b/docs/manpage_header.md index e01f03e..7765d4a 100644 --- a/docs/manpage_header.md +++ b/docs/manpage_header.md @@ -1,3 +1,3 @@ -% autojump(1) release-v22.5.2 +% autojump(1) release-v22.5.1 % -% 2018-09-07 +% 2018-09-06 From 8fffbad95ac5626f4d9688276ba8a36808c433e3 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Fri, 13 Mar 2015 15:25:29 +0800 Subject: [PATCH 14/15] put temporary data file in the same director as the data file itself This should make shutil.move use rename, which is atomic, avoiding losing data when interweaving writes happen. This will close joelthelion/autojump#358. --- bin/autojump_data.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/autojump_data.py b/bin/autojump_data.py index 2ba7fbb..d647a42 100644 --- a/bin/autojump_data.py +++ b/bin/autojump_data.py @@ -120,11 +120,12 @@ def migrate_osx_xdg_data(config): def save(config, data): """Save data and create backup, creating a new data file if necessary.""" - create_dir(os.path.dirname(config['data_path'])) + data_dir = os.path.dirname(config['data_path']) + create_dir(data_dir) # atomically save by writing to temporary file and moving to destination try: - temp = NamedTemporaryFile(delete=False) + temp = NamedTemporaryFile(delete=False, dir=data_dir) # Windows cannot reuse the same open file name temp.close() From af23852374dc30c13b25109ac0577568f408688d Mon Sep 17 00:00:00 2001 From: William Ting Date: Sun, 9 Sep 2018 09:55:27 -0700 Subject: [PATCH 15/15] Bump to 22.5.3. --- bin/autojump | 2 +- docs/autojump.1 | 2 +- docs/manpage_header.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/autojump b/bin/autojump index e7b061d..ed0151d 100755 --- a/bin/autojump +++ b/bin/autojump @@ -65,7 +65,7 @@ from autojump_utils import sanitize from autojump_utils import take from autojump_utils import unico -VERSION = '22.5.1' +VERSION = '22.5.3' FUZZY_MATCH_THRESHOLD = 0.6 TAB_ENTRIES_COUNT = 9 TAB_SEPARATOR = '__' diff --git a/docs/autojump.1 b/docs/autojump.1 index 40af970..08c841e 100644 --- a/docs/autojump.1 +++ b/docs/autojump.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 1.16.0.2 .\" -.TH "autojump" "1" "2018\-09\-06" "release\-v22.5.1" "" +.TH "autojump" "1" "2018\-09\-09" "release\-v22.5.3" "" .hy .SS NAME .PP diff --git a/docs/manpage_header.md b/docs/manpage_header.md index 7765d4a..a7b28dc 100644 --- a/docs/manpage_header.md +++ b/docs/manpage_header.md @@ -1,3 +1,3 @@ -% autojump(1) release-v22.5.1 +% autojump(1) release-v22.5.3 % -% 2018-09-06 +% 2018-09-09