-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCHANGELOG
664 lines (372 loc) · 18.6 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
INFO:log: #### 20200401214837-commitmsg ####
Do_Diff If no files in cacheDir, then switch to testing against copyDir
do_diff by default, if no argument is given, will look at checking for
any changes between cached/staged version of the tracked files and the
same in the working directory.
However if there are no files already staged for commit, then switch
to testing for changes if any between the last commit and the working
directory.
TODO: Currently if there are no files in cacheDir, only then it will
fallback to checksing wrt copyDir. However I have to think, I may
have to do a more intelligent logic, where in the default mode, I
check working directory against cacheDir for files already staged in
cacheDir and against copyDir for files which were previously not
staged in cacheDir.
INFO:log: #### 20200401213419-commitmsg ####
Improve do_diff logic
Processing of arguments related to diff command moved into a new function
called diff_args.
It takes care of raw arguments like --CA-WD, --LC-CA, --LC-WD, as well as
user friendly arguments like --cached, --commit.
The default mode if no argument passed along with diff command is that of
--CA-WD i.e diff between the cached Dir and working Dir. Bcas the changes
already in cacheDir would have been previously cross checked wrt the last
commit version, when the file was added to cacheDir. So one is potentially
mainly interested in cross checking variations between what was previously
cached and the changed done beyond it in the working directory.
The program usage message has been updated wrt the diff command arguments
INFO:log: #### 20200401210317-commitmsg ####
ssvc_fileexists_list, intelligent diff btw cacheDir and working dir
Added a ssvc_fileexists_list function, which uses the python filter
function to implement its logic. This is done to make it bit more
efficient. This function checks if the given list of files exist
in the specified base dir, and if it exists it is returned as part
of the list of files returned.
Inturn the above function is used to filter the file list in do_diff,
if the old files directory is specified as cacheDir. This ensures
that do_diff generates diffs only for the files which have been added
to the cacheDir (using add command), when cacheDir is the old-files
folder.
_commit_fileexists_list updated to use the new ssvc_fileexists_list
INFO:log: #### 20200401195222-commitmsg ####
Updating the documentation wrt the functions and its uage
INFO:log: #### 20200401170126-commitmsg ####
cat dont print newline, pass cmdline arg to do_diff
Now one can pass either --LC-CA or --LC-WD or --CA-WD
TODO: have to fix --CA-WD, bcas the current logic, shows
all the content of full file, for the files missing in
cacheDir. Note that cacheDir will only have some files
so one has to diff for only the files in cacheDir and
not for all files
INFO:log: #### 20200401164735-commitmsg ####
Use internal cat logic from do_log
INFO:log: #### 20200401163054-commitmsg ####
Commit only files specified (using add) after last commit
_cp updated to return exit status of os cp command
ssvc_cp updated to
* take the BaseSrcPath also. Bcas we will be copying between ssvc
directories like from workingDir (".") to cacheDir or from
cacheDir to copyDir
Thus to the ssvc_... helper commands, we always provide the file
involved as its tracked file info. And inturn specify any of the
ssvc directories that logic may require to work with
* return if the cp was successful or not, as a boolean
* do_add updated to use this new copy logic by passing workingDir as
the sBaseSrcPath, bcas add copies file from workingDir to cacheDir
_do_diff renamed to _do_difffile, so that the name represents its logic
of diffing a given file, clearly.
do_diff now allows its caller to explicitly specify the list of files
to work with.
* previously it was hardcoded to cross check all tracked files.
* However given that now we have a 2-step commit flow consisting of
* first adding files that need to be commited to the cacheDir over
multiple calls to add command.
* And inturn followed by calling commit command to commit only the
files in the cacheDir.
* we may either want to go through the full tracked files list or only
a subset which corresponds to those added to the cacheDir after last
commit. And this helps achieve that.
* if the file list is not explicitly specified, then the logic reverts
to the old behavior of going throu all the tracked files.
_commit_filediff updated to take the new file as the one in cacheDir and
not the one in workingDir.
_commit_filecopy updated to copy file from cacheDir to copyDir, using the
new ssvc_cp logic. Inturn if the copy is successful, then remove the file
from the cacheDir.
_commit_fileexists_list given a list of files (usually the tracked files),
it checks if any of them has been added to the cacheDir, and inturn return
the list of files, which exist in the cacheDir, for the given input file
list.
do_commit updated to
* use the new _commit_fileexists_list to get the list of files in cacheDir
to work with, instead of the previous simpler map+filter logic.
This was required bcas, the previous logic would have returned the list
of files with the cacheDir path prefixed with them. While the remaining
logic require the list of files in cacheDir, but without the cacheDir
path prefix.
* use the new do_diff, by passing the list of files found in cacheDir to it
as well as asking it to compare between the copyDir and the cacheDir.
* similarly only commit the diff of the tracked files in cacheDir to diffDir
as well as inturn copy to the copyDir from cacheDir.
INFO:log: #### 20200401155030-commitmsg ####
Fix some oversights in do_diff, get list of files in cacheDir
INFO:log: #### 20200401143133-commitmsg ####
New add-commit logic, do_diff and its helper updated
However callers of do_diff have not yet been updated.
INFO:log: #### 20200401124158-commitmsg ####
New Add logic, so as to commit only specified files - P1
Added a cacheDir, which will contain files which are added
for the next commit.
Init command updated to create the cacheDir.
ssvccopy_mkdir and ssvccopy_cp changed to ssvc_mkdir & ssvc_cp.
Previously they always assumed copyDir as the destination. Now
they take a argument which tells which is the destination.
do_add updated to only copy specified files into cacheDir, in
addition to adding it to the tracked file list. It will no
longer try to commit the file. Instead one is required to
explicitly call commit command to achieve the previous behavior.
This also means that one is no longer required to generate a
commit message for the ADD operation.
TODO: By modifying do_commit to work with either files in
working directory or cache directory, one can either commit
all changed files or only those changed files, which the user
has asked to be commited by using add after the last commit.
Thus one can control what and tracked files are commited during
any given commit operation.
TODO: May need to modify ssvc_cp further to take a BaseSrcPath
also in addition to the current BaseDestPath. Also may have to
add a recursive ssvc_removedir logic.
INFO:log: #### 20200401095900-commitmsg ####
Implement editcmsg, update its documentation
INFO:log: #### 20200401094035-commitmsg ####
Some thoughts for future
INFO:log: #### 20200401093043-commitmsg ####
Commented about args to commands, starting of editcmsg
In the process of adding a new editcmsg command. This will allow
one to edit a specified commit message.
Have added comments to commands which take arguments. Some of
them require arguments to follow compulsarily. Others support
optional arguments.
INFO:log: #### 20200331213433-commitmsg ####
Add cur second to timestamp
Sometimes if one does say init and add or add and commit back to
back within a minute, then both the commit messages will have the
same timestamp. And this will lead to sorting of log problematic.
So now even second is also added as part of timestamp. So from a
normal human perspective such issue can no longer occur.
NOTE: In future if computers are lot lot more faster and or commit
things to a ram based disk, then maybe if commands are run from
a script, there could be a issue. A remote possibility which is
currently ignored.
INFO:log: #### 202003311547-commitmsg ####
Pass TS to _commit_op, instead of it generating
In do_add, I not only require to create a OP commitmsg but also
create the full diff file for the new file being added.
Previously _commit_op was creating its own timestamp, but that
can lead to wrong time stamps for two related timestamped files
in the diffDir (i.e the add-commitmsg and diff-of-new_file).
So now _commit_op no longer creates its own ts, instead one
requires to the pass the same. So now both do_add and do_init
generate the timestamp initially and then pass it to all required
helper functions.
INFO:log: #### 202003311503-commitmsg ####
unidirectional-new-file, generate diff file while adding file
Pass --unidirectional-new-file to diff commands used as part of
do_diff and do_commit. This ensures that if we dont have a
given file in copyDir, then instead of giving a error, it will
generate a diff file corresponding to the full file content.
This all ensures that the same logic that was used in do_commit,
can be used from do_add also.
Now do_add also creates a diff file for the new file which was
added using above logic.
Also fixed a mistake in the documentation of _commit_filediff
INFO:log: #### 202003311219-commitmsg ####
peek_ingroup, document remaining functions
Renamed peek_nextarg to peek_ingroup to reflect the true
functionality of the logic.
Added documentation for the remaining functions.
INFO:log: #### 202003311004-commitmsg ####
Now hkvc-run install also calls check_install before and after the install
INFO:log: #### 202003310958-commitmsg ####
Commitmsg for Init, Document the functions.
Now init command also generates a commitmsg file in diffDirs
to help users track the event (which is the originator of the
that ssvc repository). To help with same the helper _commit_op
function moved to begining.
Also adding documentation for all the functions. Have done for
most, few remaining.
INFO:log: #### 202003291827-commitmsg ####
Moved a specific file diff logic into _do_diff
do_diff inturn now calls _do_diff.
TODO:
The reason why this logic has been restructured is so that
later I can diff a specific file rather than all files
which are being tracked.
INFO:log: #### 202003291804-OP_ADD-commitmsg ####
Added file [CHANGELOG]
INFO:log: #### 202003291803-OP_ADD-commitmsg ####
Added file [hkvc-run.sh]
INFO:log: #### 202003291755-commitmsg ####
Made dbgLvl optional argument in dprint
dbgLvl is set by default to DLVL_DEFAULT, which inturn is
set to the global gDBGLVL. This ensures that by default
the messages printed using dprint, but without specifying
the dbgLvl arg to dprint, will not get printed.
INFO:log: #### 202003291737-commitmsg ####
Implemented dprint, fixed issue with sort_diffDir
Had forgotten to return the sorted list from sort_diffDir
function. It has been fixed now.
Also implemented the dprint logic, which prints the msg
passed to it, only if the debug_level specified for the
message is smaller than the system's debug_level (which
is specified at the begining of the program).
INFO:log: #### 202003291718-commitmsg ####
Sort diffDir filelist based on timestamp
The sort_diffDir has been updated to use timestamp prefix
in the filename to decide whether it has seen all files
belonging to a given commit and inturn sort them such that
commitmsg file is first and then the remaining files of
that commit follow it.
This fixes the issue with the previous simpler sort logic.
TODO: Have to implement the dprint print logic
INFO:log: #### 202003291651-commitmsg ####
Attempt at sorting diffDir files for log printing
This is too simple a logic, which doesnt work fully.
It pushes commitmsg file to top of list, but files
which were commited as part of the same commit,
but which follow the commitmsg in default sort
order will get sorted by this new logic in the
wrong order.
INFO:log: #### 202003291621-commitmsg ####
Cleaned up the log related print logic
For commit messages it adds a boiler plate, which
identifies it has a log (commit) message.
For diff | patch | ... content, it adds a boiler
plate, which identifies it has a diff message.
INFO:log: #### 202003291600-commitmsg ####
usage info, peek_nextarg
Added more informative usage info, if nothing is specified
to ssvc when called.
Added a peek_nextarg logic, which checks if there is a arg
beyond the current arg, as requested to it, and inturn
returns that argument. If such a arg doesnt exist, then it
returns None.
In turn use this peek logic when checking for arguments
to commands in process_args. Currently used for log command.
Without this, the previous code would have raised
a exception, when trying the log command.
INFO:log: #### 202003291542-commitmsg ####
Optionally print associated diffs as part of log
Added --patch optional argument to log command. If one specifies
this argument, then along with printing the commit messages, it
also prints the associated diffs/... of each commit.
TODO: Currently the associated diffs/... of each commit is printed
first, before printing the corresponding commit message. Will have
to change the logic later OR else rename the files in diffDir such
that there is a sorting numeral after the timestamp prefix.
i.e for example TS-00-file_diff and TS-99-commit_msg
INFO:log: #### 202003291524-commitmsg ####
Print version info if no argument given
INFO:log: #### 202003291512-commitmsg ####
_commit_op helper function
Certain ops require to be tracked by storing info about
them in the diffDir of the ssvc repository, as a commit
message file.
Previously a basic logic was added to achieve the same
directly in the do_add logic. Now it has been moved into
a generic logic called _commit_op.
It takes the name of the operation that requries to be
tracked and also the message to write to the commit msg
file.
NOTE:CHANGENOTICE: Previous commit message files in
diffDir, only had OP in the middle of their name. Now
instead they have OP_<THEOPERATION> in the middle of
their name.
INFO:log: #### 202003291447-commitmsg ####
Fix a bug with commit optimisation logic last commit
Was checking specifically for 1, instead of having a
generic not 0 check, wrt the diff command. Because of
this the logic was not copying the file into copyDir.
Have fixed the logic now. Also added a debug print
to check, if things are fine still.
INFO:log: #### 202003291434-commitmsg ####
Optimise commit logic
the _commit_filediff helper logic updated to
* remove the diff file corresponding to tracked files
if they are empty (i.e no difference between working
directory version and the last commited version in
the copy directory).
This helps avoid cluttering the diff folder with empty
diff files for unchanged files (wrt each given commit)
* return true if the file is changed between copy and
working directories.
avoid copying unchanged file again into copy directory
from the working directory
Added explanation for the _commit_filediff
INFO:log: #### 202003291418-commitmsg ####
Renamed helper functions, Added comment for core context dictionary
INFO:log: #### 202003290136-commitmsg ####
Renamed the core identity from cvs to svc
So the hidden directory corresponding to the repository
is now named .simpsvc instead of .simpcvs.
NOTE: For all version control repositories which use
this program, rename the hidden repository folder manually
to make it work with this new version of the program.
INFO:log: #### 202003290133-SPECIAL-OP-commitmsg ####
SPECIAL OP, MANUAL RENAME OF the main File
MV hkvc-simple-cvs.py
TO hkvc-simple-svc.py
This involved:
move/rename the file in the working folder
rename the file entry in the srcs file.
rename the file in the copy folder.
create this special op commit message.
Obviously there is no automatic mapping of this file across
this manual move operation, by the logic.
However to help with future auto mapping or intelligent
linking of files across their rename / mv operation, I have
created that MV and TO entries at the top, as two independent
lines, so that if the filename has space (in future, haven't
tested now, so no idea, I have to think if I can have such
files now, less likely as I am not protecting the file names
within string delimiters, if I remember correctly).
INFO:log: #### 202003290119-commitmsg ####
Autocommit a message for file add operation
Now when ever any file is added into the simple svc repository,
a automatic commit message is parallely created to indicate
the same.
NOTE: SVC stands for Source Version Control, i.e my this
logic. I will be renaming things to match this shortly.
INFO:log: #### 202003290118-OP-commitmsg ####
Added file [README]
INFO:log: #### 202003282142-commitmsg ####
Added log logic
It prints the contents of all the commit msgs till date.
It prints the commit messages from latest to oldest.
By default it just cats the commit msgs. However one
can set the option bLess argument to True, so that it
uses less to print the contents, so that people can go
throu the commit messages one at a time.
INFO:log: #### 202003281349-commitmsg ####
do_diff interactive prompt logic cleaned up
INFO:log: #### 202003281340-commitmsg ####
Go ahead with commit only if changes are there
INFO:log: #### 202003281330-commitmsg ####
Make diff interactive and informative
Now one can make diff optionally interactive. i.e after each
file has been diffed, it will ask user to press any key to
continue.
Also now the do_diff logic will return info as to whether any
of the file diff'd had any difference or not.
NOTE: Later It will be used to decide, if one should go ahead
with the commit logic or not.
INFO:log: #### 202003281238-commitmsg ####
Commit updates file copy, copy helpers updated
Now when one does a commit, the files are copied
into the simple cvs's copyDir.
TO help with above, the copy related logics have
been refactored.
* previous sgcopy_cp has been renamed to _cp
* New sgcopy_cp takes the simpcvs me context,
as well as the file to copy. It no longer
requires the destination path to be specified.
The logic will automatically determines the
destination path in copyDir, from the given
file to copy.
INFO:log: #### 202003281217-commitmsg ####
Added initial logic for commit
* Added logic to add a commit message
if the commit message is less than 5 chars, avoid commit
Copy the commit message into the diffDir
* create the diff file for each file in diffDir
All contents of the diffDir have timestamp prefixed to it