Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete existing sources on profile overwrite #1942 #1958

Closed

Conversation

TheLazron
Copy link
Contributor

@TheLazron TheLazron commented Mar 6, 2024

Description

If overwrite is checked on profile import, existing sources for that profile are deleted before adding the new ones from the json file for that profile

Related Issue

Fixes #1942

Motivation and Context

Checking overwrite when importing an existing profile, resulted in duplicate source folders. The changes make sure to delete the existing set of sources before adding new ones for that profile

How Has This Been Tested?

This has been tested by exporting a profile with existing sources and importing it again. After checking overwriting existing profile, only the new set of sources were being used

Screenshots (if appropriate):

1
3
4

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

@TheLazron TheLazron marked this pull request as ready for review March 7, 2024 10:01
@real-yfprojects
Copy link
Collaborator

real-yfprojects commented Apr 1, 2024

THank you very much. Looks good! Is it possible to add a test case checking for this bug?

@TheLazron
Copy link
Contributor Author

Sure!

@shivansh02
Copy link
Collaborator

Hey @TheLazron are you still working on this?

shivansh02 and others added 10 commits June 7, 2024 14:59
Our `DiffResultDialog` and `ExtractDialog` show a context menu for items of the list/tree view. The collapse action in this menu only makes sense for the tree mode of the view. This commit therefore enables the option only for this view mode.

* src/vorta/views/extract_dialog.py
* src/vorta/views/diff_result.py

* tests/unit/test_diff.py : Add tests for the new behaviour.
* tests/unit/test_extract.py
The profile list in the main window is already sorted by name (alphabetically, case-sensitive). However the profile list in the *Backup Now* action found in the tray menu wasn't. This commit constructs the sql query to return the profiles in order.

* src/vorta/tray_menu.py
@shivansh02 shivansh02 force-pushed the duplicate-sources-on-overwrite-#1942 branch from 75f6e54 to ca15511 Compare June 7, 2024 09:38
@TheLazron TheLazron closed this Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicated "source folders" on export and import of the same profile
7 participants