The following changes to ui/repo.py help to intact parent_id in order to know that its a forked repo. The check repo.parent is to see if the main repo is deleted. The corresoonding changes are done in the UI.
ui/repo.py
parent_id
repo.parent
@puiterwijk This is what I came up with .
I doubt this will work, how which DBMS did you test it?
rebased
1 new commit added
@pingou I tested that in sqlite , then I reverted and made a different change as we discussed :smile:
Should we also put a check if repo.parent exists here ?
And an extra space here
@vivekanand1101 there is a change I am doing let me do that first :P
but agreed on those too :)
5 new commits added
I am really sorry about the chaos caused by 26 files I should have thought through things ! :disappointed:
Not up to date?
So what happens if the project is a fork w/o parent?
not pep8 valid
sorry ? How?
I was curious why not create directly with the column name: is_fork ?
is_fork
@farhaan since here, its about getting the parentpath , can we adjust according to if/elif/else condition and give the parent's path the same path as the forked repo itself ?
parentpath
@vivekanand1101 yes and when we did if repo.is_fork and repo.parent we were doing the same thing. Now when we came to that since the repo was initially fork the pull requests is disable[1] so you will see a New Pr button but you will not be able to make pull request. So the question arises do we need user to make a PR to this if yes then we can just enable pull request on deletion of main.
if repo.is_fork and repo.parent
repo
pull requests
New Pr
pull request
[1] https://pagure.io/pagure/blob/master/f/pagure/lib/init.py#_1383
@vivekanand1101 yes and when we did if repo.is_fork and repo.parent we were doing the same thing.
That would have landed in GIT_FOLDER but this should be in FORK_FOLDER, i guess.
GIT_FOLDER
FORK_FOLDER
About enabling pull requests, i remember the logic behind disabling on forks by default was: "since on pagure, forks are used just to develop the main projects: it would be nice that PRs and Issue trackers are disabled by default". And since we are dealing with the case when the main project is deleted i think, that logic doesn't apply. I would be :thumbsup: for enabling PRs when the main project is deleted.
Forks are generally found in GIT_FOLDER like forks/<user>/<project_name> so I think that will be fine.
forks/<user>/<project_name>
Forks are generally found in GIT_FOLDER like forks// so I think that will be fine. should be fine :/
So what if there are no parent? Is it still a fork or not? What's the point of is_fork if we always need to check for .parent?
.parent
Maybe we could add a comment as to what you are trying to do here, I'm not sure to follow your reasonning
Any discussions pending here ?
Proposal: Fork from a delete repo
Fork from a delete repo
I still have an issue with /fork/pingou/test/commits/master
/fork/pingou/test/commits/master
Have you considered adding a new unit-tests file dedicated to just this?
I am working on the unit test and i fixed the error !
@vivekanand1011 added a new revision so we'll need to adjust this one once again :)
Can i get the diff for alembic revision ? :)
@farhaan you should have the file itself (you rebased). Just change the revision ids and you should be fine.
btw, it's vivekanand1101 :stuck_out_tongue:
vivekanand1101
I guess this one needs to be adjusted as well
12 new commits added
Ok, let's do a final rebase and merge this :)
Ok I rebased it, merging :)
Pull-Request has been merged by pingou
Thanks for rebasing :smile:
The following changes to
ui/repo.pyhelp to intactparent_idinorder to know that its a forked repo. The check
repo.parentis to seeif the main repo is deleted. The corresoonding changes are done in the
UI.