simple-vcs 1.0.0__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simple_vcs-1.2.0/PKG-INFO +352 -0
- simple_vcs-1.0.0/simple_vcs.egg-info/PKG-INFO → simple_vcs-1.2.0/README.md +310 -278
- simple_vcs-1.2.0/pyproject.toml +27 -0
- {simple_vcs-1.0.0 → simple_vcs-1.2.0}/setup.py +39 -36
- {simple_vcs-1.0.0 → simple_vcs-1.2.0}/simple_vcs/__init__.py +10 -10
- simple_vcs-1.2.0/simple_vcs/cli.py +146 -0
- simple_vcs-1.2.0/simple_vcs/core.py +569 -0
- simple_vcs-1.2.0/simple_vcs.egg-info/PKG-INFO +352 -0
- {simple_vcs-1.0.0 → simple_vcs-1.2.0}/simple_vcs.egg-info/SOURCES.txt +1 -0
- simple_vcs-1.2.0/simple_vcs.egg-info/requires.txt +2 -0
- simple_vcs-1.0.0/PKG-INFO +0 -278
- simple_vcs-1.0.0/README.md +0 -247
- simple_vcs-1.0.0/simple_vcs/cli.py +0 -54
- simple_vcs-1.0.0/simple_vcs/core.py +0 -276
- simple_vcs-1.0.0/simple_vcs.egg-info/requires.txt +0 -1
- {simple_vcs-1.0.0 → simple_vcs-1.2.0}/LICENSE +0 -0
- {simple_vcs-1.0.0 → simple_vcs-1.2.0}/MANIFEST.in +0 -0
- {simple_vcs-1.0.0 → simple_vcs-1.2.0}/requirements.txt +0 -0
- {simple_vcs-1.0.0 → simple_vcs-1.2.0}/setup.cfg +0 -0
- {simple_vcs-1.0.0 → simple_vcs-1.2.0}/simple_vcs/utils.py +0 -0
- {simple_vcs-1.0.0 → simple_vcs-1.2.0}/simple_vcs.egg-info/dependency_links.txt +0 -0
- {simple_vcs-1.0.0 → simple_vcs-1.2.0}/simple_vcs.egg-info/entry_points.txt +0 -0
- {simple_vcs-1.0.0 → simple_vcs-1.2.0}/simple_vcs.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: simple-vcs
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: A beautiful and simple version control system with a modern terminal interface
|
|
5
|
+
Home-page: https://github.com/muhammadsufiyanbaig/simple_vcs
|
|
6
|
+
Author: Muhammad Sufiyan Baig
|
|
7
|
+
Author-email: Muhammad Sufiyan Baig <send.sufiyan@gmail.com>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2024 SimpleVCS
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
Project-URL: Homepage, https://github.com/muhammadsufiyanbaig/simple_vcs/
|
|
30
|
+
Project-URL: Repository, https://github.com/muhammadsufiyanbaig/simple_vcs.git
|
|
31
|
+
Project-URL: Issues, https://github.com/muhammadsufiyanbaig/simple_vcs/issues
|
|
32
|
+
Keywords: version-control,vcs,simple-vcs,backup,snapshot
|
|
33
|
+
Requires-Python: >=3.7
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
License-File: LICENSE
|
|
36
|
+
Requires-Dist: click>=7.0
|
|
37
|
+
Requires-Dist: rich>=10.0.0
|
|
38
|
+
Dynamic: author
|
|
39
|
+
Dynamic: home-page
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
Dynamic: requires-python
|
|
42
|
+
|
|
43
|
+
# SimpleVCS
|
|
44
|
+
|
|
45
|
+
A simple version control system written in Python that provides basic VCS functionality similar to Git - now with a **beautiful modern terminal interface**!
|
|
46
|
+
|
|
47
|
+
## ✨ New in Version 1.2.0
|
|
48
|
+
|
|
49
|
+
**Stunning Visual Interface** - SimpleVCS now features a gorgeous terminal interface powered by Rich:
|
|
50
|
+
- 🎨 **Colored Output** - Color-coded messages for success, warnings, and errors
|
|
51
|
+
- 📊 **Beautiful Tables** - Commit history and status displayed in elegant tables
|
|
52
|
+
- 📦 **Styled Panels** - Information presented in clean, bordered boxes
|
|
53
|
+
- 🌟 **Professional Look** - Modern, easy-to-read formatting throughout
|
|
54
|
+
|
|
55
|
+
## Features
|
|
56
|
+
|
|
57
|
+
- Initialize repositories
|
|
58
|
+
- Add files to staging area
|
|
59
|
+
- Commit changes with messages or timestamps
|
|
60
|
+
- View commit history with detailed information
|
|
61
|
+
- Show differences between commits
|
|
62
|
+
- Repository status tracking
|
|
63
|
+
- Cross-platform compatibility
|
|
64
|
+
- Both CLI and Python API support
|
|
65
|
+
- Quick revert to any previous commit
|
|
66
|
+
- Create and restore from snapshots
|
|
67
|
+
- Automatic object compression to save space
|
|
68
|
+
- Simplified workflow compared to Git
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
|
|
72
|
+
### From PyPI (when published)
|
|
73
|
+
```bash
|
|
74
|
+
pip install simple-vcs
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### From Source
|
|
78
|
+
```bash
|
|
79
|
+
# Clone the repository
|
|
80
|
+
git clone https://github.com/muhammadsufiyanbaig/simple_vcs.git
|
|
81
|
+
cd simple_vcs
|
|
82
|
+
|
|
83
|
+
# Install in development mode
|
|
84
|
+
pip install -e .
|
|
85
|
+
|
|
86
|
+
# Or install normally
|
|
87
|
+
pip install .
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Quick Start
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Initialize a new repository
|
|
94
|
+
svcs init
|
|
95
|
+
|
|
96
|
+
# Create a sample file
|
|
97
|
+
echo "Hello World" > hello.txt
|
|
98
|
+
|
|
99
|
+
# Add file to staging area
|
|
100
|
+
svcs add hello.txt
|
|
101
|
+
|
|
102
|
+
# Commit the changes
|
|
103
|
+
svcs commit -m "Add hello.txt"
|
|
104
|
+
|
|
105
|
+
# View commit history
|
|
106
|
+
svcs log
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Usage
|
|
110
|
+
|
|
111
|
+
### Command Line Interface
|
|
112
|
+
|
|
113
|
+
#### Repository Management
|
|
114
|
+
```bash
|
|
115
|
+
# Initialize a new repository in current directory
|
|
116
|
+
svcs init
|
|
117
|
+
|
|
118
|
+
# Initialize in specific directory
|
|
119
|
+
svcs init --path /path/to/project
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### File Operations
|
|
123
|
+
```bash
|
|
124
|
+
# Add single file
|
|
125
|
+
svcs add filename.txt
|
|
126
|
+
|
|
127
|
+
# Add multiple files
|
|
128
|
+
svcs add file1.txt file2.py file3.md
|
|
129
|
+
|
|
130
|
+
# Check repository status
|
|
131
|
+
svcs status
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### Commit Operations
|
|
135
|
+
```bash
|
|
136
|
+
# Commit with message
|
|
137
|
+
svcs commit -m "Your commit message"
|
|
138
|
+
|
|
139
|
+
# Commit with auto-generated timestamp
|
|
140
|
+
svcs commit
|
|
141
|
+
|
|
142
|
+
# View commit history
|
|
143
|
+
svcs log
|
|
144
|
+
|
|
145
|
+
# View limited commit history
|
|
146
|
+
svcs log --limit 5
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
#### Viewing Differences
|
|
150
|
+
```bash
|
|
151
|
+
# Show diff between last two commits
|
|
152
|
+
svcs diff
|
|
153
|
+
|
|
154
|
+
# Show diff between specific commits
|
|
155
|
+
svcs diff --c1 1 --c2 3
|
|
156
|
+
|
|
157
|
+
# Show diff between commit 2 and latest
|
|
158
|
+
svcs diff --c1 2
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
#### Advanced Operations
|
|
162
|
+
```bash
|
|
163
|
+
# Quickly revert to a specific commit
|
|
164
|
+
svcs revert 3
|
|
165
|
+
|
|
166
|
+
# Create a snapshot of current state
|
|
167
|
+
svcs snapshot
|
|
168
|
+
|
|
169
|
+
# Create a named snapshot
|
|
170
|
+
svcs snapshot --name my_backup
|
|
171
|
+
|
|
172
|
+
# Restore from a snapshot
|
|
173
|
+
svcs restore path/to/snapshot.zip
|
|
174
|
+
|
|
175
|
+
# Compress stored objects to save space
|
|
176
|
+
svcs compress
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Python API
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
from simple_vcs import SimpleVCS
|
|
183
|
+
|
|
184
|
+
# Create VCS instance
|
|
185
|
+
vcs = SimpleVCS("./my_project")
|
|
186
|
+
|
|
187
|
+
# Initialize repository
|
|
188
|
+
vcs.init_repo()
|
|
189
|
+
|
|
190
|
+
# Add files
|
|
191
|
+
vcs.add_file("example.txt")
|
|
192
|
+
vcs.add_file("script.py")
|
|
193
|
+
|
|
194
|
+
# Commit changes
|
|
195
|
+
vcs.commit("Initial commit with example files")
|
|
196
|
+
|
|
197
|
+
# Show commit history
|
|
198
|
+
vcs.show_log()
|
|
199
|
+
|
|
200
|
+
# Show differences between commits
|
|
201
|
+
vcs.show_diff(1, 2)
|
|
202
|
+
|
|
203
|
+
# Check repository status
|
|
204
|
+
vcs.status()
|
|
205
|
+
|
|
206
|
+
# Quick revert to a specific commit
|
|
207
|
+
vcs.quick_revert(2)
|
|
208
|
+
|
|
209
|
+
# Create a snapshot of current state
|
|
210
|
+
vcs.create_snapshot()
|
|
211
|
+
vcs.create_snapshot("my_backup")
|
|
212
|
+
|
|
213
|
+
# Restore from a snapshot
|
|
214
|
+
vcs.restore_from_snapshot("my_backup.zip")
|
|
215
|
+
|
|
216
|
+
# Compress stored objects to save space
|
|
217
|
+
vcs.compress_objects()
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Advanced Usage
|
|
221
|
+
|
|
222
|
+
### Working with Multiple Files
|
|
223
|
+
```python
|
|
224
|
+
from simple_vcs import SimpleVCS
|
|
225
|
+
from simple_vcs.utils import get_all_files
|
|
226
|
+
|
|
227
|
+
vcs = SimpleVCS()
|
|
228
|
+
vcs.init_repo()
|
|
229
|
+
|
|
230
|
+
# Add all Python files in current directory
|
|
231
|
+
python_files = [f for f in get_all_files(".") if f.endswith('.py')]
|
|
232
|
+
for file in python_files:
|
|
233
|
+
vcs.add_file(file)
|
|
234
|
+
|
|
235
|
+
vcs.commit("Add all Python files")
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Repository Structure
|
|
239
|
+
When initialized, SimpleVCS creates a `.svcs` directory containing:
|
|
240
|
+
```
|
|
241
|
+
.svcs/
|
|
242
|
+
├── objects/ # File content storage (hashed)
|
|
243
|
+
├── commits.json # Commit history and metadata
|
|
244
|
+
├── staging.json # Currently staged files
|
|
245
|
+
└── HEAD # Current commit reference
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Requirements
|
|
249
|
+
|
|
250
|
+
- Python 3.7 or higher
|
|
251
|
+
- click>=7.0 (for CLI functionality)
|
|
252
|
+
- rich>=10.0.0 (for beautiful terminal interface)
|
|
253
|
+
|
|
254
|
+
## Development
|
|
255
|
+
|
|
256
|
+
### Setting up Development Environment
|
|
257
|
+
```bash
|
|
258
|
+
# Clone the repository
|
|
259
|
+
git clone https://github.com/muhammadsufiyanbaig/simple_vcs.git
|
|
260
|
+
cd simple_vcs
|
|
261
|
+
|
|
262
|
+
# Create virtual environment
|
|
263
|
+
python -m venv venv
|
|
264
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
265
|
+
|
|
266
|
+
# Install in development mode
|
|
267
|
+
pip install -e .
|
|
268
|
+
|
|
269
|
+
# Install development dependencies
|
|
270
|
+
pip install pytest pytest-cov black flake8
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Running Tests
|
|
274
|
+
```bash
|
|
275
|
+
# Run all tests
|
|
276
|
+
pytest
|
|
277
|
+
|
|
278
|
+
# Run with coverage
|
|
279
|
+
pytest --cov=simple_vcs
|
|
280
|
+
|
|
281
|
+
# Run specific test file
|
|
282
|
+
pytest tests/test_core.py
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## Contributing
|
|
286
|
+
|
|
287
|
+
1. Fork the repository
|
|
288
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
289
|
+
3. Make your changes
|
|
290
|
+
4. Add tests for your changes
|
|
291
|
+
5. Ensure tests pass (`pytest`)
|
|
292
|
+
6. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
293
|
+
7. Push to the branch (`git push origin feature/amazing-feature`)
|
|
294
|
+
8. Open a Pull Request
|
|
295
|
+
|
|
296
|
+
## Publishing to PyPI
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
# Install build tools
|
|
300
|
+
pip install build twine
|
|
301
|
+
|
|
302
|
+
# Build the package
|
|
303
|
+
python -m build
|
|
304
|
+
|
|
305
|
+
# Upload to PyPI (requires PyPI account)
|
|
306
|
+
twine upload dist/*
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Limitations
|
|
310
|
+
|
|
311
|
+
This is a simple implementation for educational purposes. It lacks advanced features like:
|
|
312
|
+
- Branching and merging
|
|
313
|
+
- Remote repositories
|
|
314
|
+
- File conflict resolution
|
|
315
|
+
- Large file handling
|
|
316
|
+
- Advanced diff algorithms
|
|
317
|
+
|
|
318
|
+
## License
|
|
319
|
+
|
|
320
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
321
|
+
|
|
322
|
+
## Author
|
|
323
|
+
|
|
324
|
+
Muhammad Sufiyan Baig - send.sufiyan@gmail.com
|
|
325
|
+
|
|
326
|
+
Project Link: [https://github.com/muhammadsufiyanbaig/simple_vcs](https://github.com/muhammadsufiyanbaig/simple_vcs)
|
|
327
|
+
|
|
328
|
+
## Changelog
|
|
329
|
+
|
|
330
|
+
### Version 1.2.0
|
|
331
|
+
- **Beautiful Terminal Interface**: Complete visual overhaul with Rich library
|
|
332
|
+
- **Colored Output**: Green for success, yellow for warnings, red for errors
|
|
333
|
+
- **Elegant Tables**: Commit history, status, and diffs in formatted tables
|
|
334
|
+
- **Styled Panels**: Information displayed in bordered panels with rounded corners
|
|
335
|
+
- **Enhanced Commands**: All commands now have beautiful, professional output
|
|
336
|
+
- **Better UX**: Clear visual hierarchy and consistent formatting
|
|
337
|
+
- **Windows Compatible**: No problematic Unicode characters
|
|
338
|
+
- **Enhanced Help**: Detailed descriptions and examples for all commands
|
|
339
|
+
|
|
340
|
+
### Version 1.1.0
|
|
341
|
+
- Added quick revert functionality to go back to any commit instantly
|
|
342
|
+
- Added snapshot creation and restoration features
|
|
343
|
+
- Added automatic object compression to save disk space
|
|
344
|
+
- Improved CLI with new commands (revert, snapshot, restore, compress)
|
|
345
|
+
- Enhanced documentation and examples
|
|
346
|
+
- Fixed CLI entry point issue for direct terminal usage
|
|
347
|
+
|
|
348
|
+
### Version 1.0.0
|
|
349
|
+
- Initial release
|
|
350
|
+
- Basic VCS functionality (init, add, commit, log, diff, status)
|
|
351
|
+
- CLI and Python API support
|
|
352
|
+
- Cross-platform compatibility
|