I recently took over the development of a Python/ Django project, where Git is used as the version control for software maintenance and releases etc.
Having not used Git much at all before, I am still getting used to how to use it to manage version control effectively.
I recently pushed some changes to the server to fix a particular bug- this bug has now been fixed, and the feature is working correctly on the live version of the software.
However, when merging the branch
on which I had been developing with the master
branch, I needed to reset
to an old version of the code as I managed to break my local master
branch.
Now, having pushed my local master
to the server, with the fix for this bug implemented, it seems that I have broken another page on the server- there were some issues with this page a month or so ago, which I fixed at the time, and the reset
that I performed on my local master was to a version that was last modified a few days ago, so this bug should not have been in the version that I reset to, but somehow this seems to have broken this other page, even though it was working prior to pushing the most recent bug fix to the server.
I have several branches on my local machine, so tried checking out an old one, where I know that this page still works- and having browsed to it on my local server, I can see that it does.
I then ran a git diff master exportAddsOmits
, where exportAddsOmits
is the name of the old branch on which the broken page is still working. This command has produced the following output:
(moon) user:moon user$ git diff master exportAddsOmits
diff --git a/buying/views.py b/buying/views.py
index 08d2fd6..b2f8fe6 100644
--- a/buying/views.py
+++ b/buying/views.py
@@ -651,10 +651,7 @@ def order(request, supplier_id):
# project = Project.objects.get(id=request.GET.get('project'))
order_form.initial['project_raw'] = request.GET.get('project')
- #project_choices = OrderItem.NON_PROJECT_CHOICES+[('', '-----')]+[(project.id, project.project_name) for project in Project.objects.filter(archived=False, detailed_status=Project.ds9).order_by('project_name')]
- #(23/11/2016 @ 1110) Add 'Deposit Received' projects to drop down in 'Item Project':
project_choices = OrderItem.NON_PROJECT_CHOICES+[('', '-----')]+[(project.id, project.project_name) for project in Project.objects.filter(archived=False, detailed_status=Project.ds9).order_by('project_name')]+[(project.id, project.project_name) for project in Project.objects.filter(archived=False, detailed_status=Project.ds8).order_by('project_name')]
-
+ project_choices = OrderItem.NON_PROJECT_CHOICES+[('', '-----')]+[(project.id, project.project_name) for project in Project.objects.filter(archived=False, detailed_status=Project.ds9).order_by('project_name')]
top_category_choices = [('', '')] + [(cat.id, cat.name) for cat in Category.objects.filter(parent__isnull=True).distinct().only('name')[:10]] + [('OP', 'Office Purchase')]
diff --git a/costing/models.py b/costing/models.py
index 5b78684..d845da7 100644
--- a/costing/models.py
+++ b/costing/models.py
@@ -732,12 +732,8 @@ class Deposit(models.Model):
def adjust_payment(self):
p = Payment.objects.get_or_create(project=self.project, is_booking_deposit=True)[0]
p.date_paid = self.date_received
- print "p.date_paid has been set to self.date_received in Deposit.adjust_payment (costing/models.py)"
p.amount_exc_vat = self.amount_exc_vat
- #p.deposit = self.deposit
- # ERF(21/11/2016 @ 1645) Try adding a line for date_received
- #p.date_received = self.date_received
- #print "p.date_received is being set to self.date_received in costing/models.py (line 739): %s " % p.date_received
+ p.deposit = self
p.save()
def __str__(self):
diff --git a/costing/templates/costing/adds_omits.html b/costing/templates/costing/adds_omits.html
index 4d28188..a33fde5 100644
--- a/costing/templates/costing/adds_omits.html
+++ b/costing/templates/costing/adds_omits.html
@@ -24,12 +24,6 @@
What I'm not sure is how to interpret this... There are a number of lines beginning with either +
or -
, which I understand to be the diff
command showing me lines that exist in the first branch, but not in the second, or lines that don't exist in the first branch, but do in the second... but I don't know which way round this is...
Are the lines beginning with -
lines that exist in the first branch that I gave the diff
(i.e. master
), but not the second (i.e. exportAddsOmits
) and lines beginning with +
lines that don't exist in the first branch (master
), but do in the second (exportAddsOmits
), or is it the other way around?
Will I need to resolve these differences manually, or can I merge the old branch (exportAddsOmits
) with my master
branch? If I do merge, is this likely to undo the fix that I have just implemented?